PDA

View Full Version : How to hide rows of a grid



mcadirci
16 Sep 2010, 6:28 AM
Hello,
I want to hide some rows of a grid.
I can't find a function to hide. What I need is smt like:

if ( myGrid.store.data.items[0].data.filterThis ){

//myGrid.store.data.items[0].??hide(true);
}
Some advise would be great.
There is a function at store like filterBy() if this can hide rows how can I use this?
Thanks a lot.
--Mehmet

troseberry
16 Sep 2010, 6:57 AM
If you use the filterBy method then this calls a function on each record of the store and then depending on the return value (True or False) it will/will not inlcude the record.

Heres an example

thisCmp.store.filterBy(function (record, id) {
if (record.get('ProjectType') == config.projectType)
{
if (!packageTypes.disjoint([record.get('Title')]))
{
return true
}
}
else
{
return false;
}
});

mcadirci
16 Sep 2010, 10:01 PM
Thank you very much,

Record is the store's item, this worked like magic since I put all the conditions at the item.

--
Mehmet