PDA

View Full Version : Dataset Filtering Issue


RysChwith
03-11-2005, 05:15 PM
I'm having some problems displaying a filtered dataset in a list (all v2 components). I'm using the following function for the filtering:function selectCoverage( option:String ):Void {
//xmlDataSet.filtered = false;
if( dataFilter == option ) {
dataFilter = "";
} else {
xmlDataSet.filtered = true;
xmlDataSet.filterFunc = function( item:Object ):Boolean {
trace( item.coverage.attributes.type == option );
return( item.coverage.attributes.type == option );
}
dataFilter = option;
}
xmlDataSet.filtered = false;
xmlDataSet.filtered = true;
ListBox.removeAll();
fillBox();
}The list is then populated with this function:function fillBox() {
ListBox.removeAll();
xmlDataSet.refreshDestinations();
ListBox.sortItemsBy( "label", "ASC" );
ListBox.selectedIndex = 0;
}I know that function works, because it's the same one that loads the list initially.

I think what's happening is that the dataset is filtering, but the list isn't repopulating properly. It still shows all the results, not just the filtered ones. Also, the sorting seems to go funky, toggling off or on every time. Ideas?

Rys