Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide rows in ExtJS GridPanel?

Tags:

extjs

Suppose I know which row index to target (with this.rowToBeDeleted having a value of 2, say), how can I hide this row only from the grid but not the store (I have a flag in the store, which signifies what rows should be deleted from the db later in my PHP webservice code).

like image 347
ppecher Avatar asked Mar 04 '11 18:03

ppecher


1 Answers

I suggest using store.FilterBy() and pass a function to test the value of the value in rowToBedeleted:

store.filterBy(function(record) {
    return record.get("rowToBeDeleted") != 2;
});

I wrote a basic blogpost about gridfiltering a while ago, you can read it here: http://aboutfrontend.com/extjs/extjs-grid-filter/

like image 110
Nils-Fredrik Avatar answered Nov 16 '22 01:11

Nils-Fredrik