Welcome to Kap Lab Store

Topic "Using DataFilteringTextInput with mx AdvancedDataGrid"


2 Item(s)

per page
We are trying to use the DataFilteringtextInput with the AdvancedDataGrid and we experienced strange behaviour (at least not the expected one). We did not use the spark data grid because it is lacking the Drag and Drop support.

Our DataGrid is populated with an ArrayCollection. In our samplpe we used US states like:
_dataProvider = new ArrayCollection(
[
{ "name":"Alabama" },
{ "name":"Alaska" },
{ "name":"Arizona" },
...

The symptom is that typing letters such as "ba" not only shows Alabama (good) but also georgia for instance (weird). The reason we found is that the array collection objects have been added another hidden entry "mx_internal_uid" which is somehow an hexa string and filtering also occurs on this column (if no column is specified).

Note that we would like to be able to not specify the filteredProperties by default; thus we were wondering if it would be possible to specify it "all but something" and why there seems to be no such issue on sparks DG.
any hints / help appreciated
thanks
Posted : 21 December 2011 10:36
mx_internal_uid is automatically set by the Flex framework on objects that are dynamic and don't implement IUID interface.
By default, DataFilteringTextInput filters on all object properties. That means it will also filter on mx_internal_uid property.

If I were you, I wouldn't use dynamic classes at all because it's slower.
Create a typed object and this property won't be added anymore.
package
{
	public class Country
	{
		private var name:String;
 
		public function Country(name:String)
		{
			this.name = name;
		}
	}
}
 
...
var _dataProvider = new ArrayCollection(
				[
					{ new Country("Alabama") },
					{ new Country("Alaska") },
					{ new Country("Arizona") },
					...
			]);
 
Posted : 21 December 2011 10:59

2 Item(s)

per page