I have
- One arraycollection called ordersAC which contains number of dynamic data like orderId.
- Another arraycollection is the dataprovider of the datagrid called ordersRecordAC, Contains (orderId, orderTitle, orderDescription, price).
DataGrid contains 4 columns:
No. OrderTitle OrderDescription Price
Now, DataGrid has 100 record. And I want to filter DataGrid using first arraycollection(ordersAC) which is dynamically changed every time.
like: ordersAC has 5 orderId
1521, 2154, 2233, 5484, 2351
then in DataGrid display only 5 records depend on orderId
.
I tried following ways but didn't work:
private function onSearchRecordClick(event:FlexEvent):void
{
var orderAC:ArrayCollection = ordersGridId.orderAC;
for(var i:int = 0; i<ordersRecordAC.length-1;i++)
{
orderAC.filterFunction = filterRows;
function filterRows(item1:Object):Boolean
{
if(item1.orderId == ordersRecordAC[i])
return true;
else
return false;
}
}
orderAC.refresh();
}
<mx:DataGrid id="ordersGridId" lockedColumnCount="5" dataProvider="{orderAC}" sortableColumns="true">
Hope Understand my question.
Thanks.