I have an issue with live filtering with a datagrid. I'm able to filter on
columns thats has EVERY SINGLE ROW filled in. However, on the columns that
have multiple empty rows, the filtering function doesn't want to trigger?
When I do and Alert.show() it shows up the items. ODD.... Anyways, here is
my snippet..
private function filterEvent(): void
{
cPlayList.source.filterFunction =
filterPlayList;
cPlayList.source.refresh();
}
private function filterPlayList(oItem:Object): Boolean
{
var bMatch:Boolean = false;
switch (filterComboBox.selectedItem.toString())
{
case "Title":
bMatch =
(oItem.name.toLowerCase().search(filterSearchInput.text.toLowerCase()) !=
-1);
break;
case "Artist":
bMatch =
(oItem.artist.toLowerCase().search(filterSearchInput.text.toLowerCase()) !=
-1);
break;
case "Album":
bMatch =
(oItem.album.toLowerCase().search(filterSearchInput.text.toLowerCase()) !=
-1);
break;
case "Genre":
bMatch =
(oItem.genre.toLowerCase().search(filterSearchInput.text.toLowerCase()) !=
-1);
break;
}
return bMatch;
}
<mx:DataGrid
x="169" y="91" width="475"
height="340"
id="libraryDataGrid"
dataProvider="{cPlayList.source}"
styleName="libaryScroll">
<mx:columns>
<mx:DataGridColumn headerText="Title" dataField="name"/>
<mx:DataGridColumn headerText="Artist"
dataField="artist"/>
<mx:DataGridColumn headerText="Album"
dataField="album"/>
<mx:DataGridColumn headerText="Length"
dataField="total_time"
labelFunction="formatDuration"/>
<mx:DataGridColumn headerText="Genre"
dataField="genre"/>
</mx:columns>
</mx:DataGrid>
--
View this message in context:
http://www.nabble.com/Datagrid-Filtering-Help%21-tf3341594.html#a9293557
Sent from the FlexCoders mailing list archive at Nabble.com.