PDA

View Full Version : Hide grid rows depending on record value (getRowClass occupied)



Dr. Flink
23 Jan 2009, 2:08 AM
Hi! I need to hide rows depending on a records value. The grid is using the RowExpander plugin which is already overriding the getRowClass method.
And I don't wont to remove the records from the store.

Some other way to do this? A beforerowinserted (not: beforerowsinserted) event that could return false to skip inserting the row to the grid would be convenient...

Animal
23 Jan 2009, 2:14 AM
Store.filter or Store.filterBy?

Dr. Flink
23 Jan 2009, 2:33 AM
But this will remove the records from the store, and I don't want that.

I have x amount of rows in the grid. The user should be able to select rows and replace these with one "parent" row. The replaced rows (children) is still going to be saved to the db, but with a parent_id attached to them (the new replacing row).

Animal
23 Jan 2009, 2:36 AM
No, it just filters them. You can clearFilters

Dr. Flink
23 Jan 2009, 3:04 AM
Ah, thats perfect. I just call clearFilters before sending to server.

...but, how do I match null values with regExp? :-?

Dr. Flink
23 Jan 2009, 5:34 AM
*bumb*
I need to filter out all records with parent_id set to null.
RegExp != my favourite...

Condor
23 Jan 2009, 5:42 AM
Use filterBy() instead of filter().

pratapbm
12 Mar 2009, 3:07 AM
I have a grid with few records which are coming from server. Each record has few HTML elements(some text boxes with id in <DIV> tag). I use document.getElementById() to get the value present in those tex boxes. I am using the store's filter() to hide the rows. When I use clearFilter to get hidden rows back, document.getElementById() returns null for those rows.
Please let me know if I am missing anything there.


TIA

Condor
12 Mar 2009, 6:40 AM
You can only query the id after the rows have been rendered (the gridview normally defers row render by 50ms after clearFilter modifies the store).

Try setting deferRowRender:false in the gridpanel config.

ritudec27
5 Jul 2012, 11:18 PM
I have a popup that shows all the records with checkbox in grid. After selection of some of these i want to show those selected records in another list. This list is using same store.
If i use store.filter() then it filter my all components those are using same store. And clearfilter() make available all records in popup again but the selected records list also populated with entire data.

In this case what is the alternate to show/hide rows of grid?

Dr. Flink
6 Jul 2012, 1:12 AM
I have a popup that shows all the records with checkbox in grid. After selection of some of these i want to show those selected records in another list. This list is using same store.
If i use store.filter() then it filter my all components those are using same store. And clearfilter() make available all records in popup again but the selected records list also populated with entire data.

In this case what is the alternate to show/hide rows of grid?

You could create a new store for the "other" list (still using the same model).