PDA

View Full Version : If record.get("value")==null... dont show record in grid



jorgeluislay
26 Sep 2012, 6:14 AM
Can someone help me with this issue ?

If (record.get("value")==null){
... dont show record in grid
}

how to do this ?

scottmartin
26 Sep 2012, 10:44 AM
Have a look at filter()
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-filter

You can use this in your store.load event.

Scott.

jorgeluislay
27 Sep 2012, 8:13 AM
Great! That was easy..

store.on('load', function(){
store.filter('state', 'NEW', true, true);

});

How can i filter one more time in a filtered store from the database without losing the filtered data i get once loading the grid ?

Im experiancing some issues that i dont really understand.

-->store from backend:
----> filtered store: (store i use for the grid)
-------> filter store again (without deleting the first filter but adding a ne filter)

scottmartin
27 Sep 2012, 8:38 AM
I have found that if you have a server involved, perform all the filter server level is the best option. It is faster, and you send only the data you need instead sending all that data and then filtering.

Scott.

jorgeluislay
27 Sep 2012, 8:47 AM
Thank you for those wise words but i have to figure it out on the frontend how to find a solution for this issue.

I just get one answer from backend and i have to show about 5 grids with different stores (filtered) and each grid has a search textfield which does filter it again (second filter) but the second filter delete or overwrite the first filter. And i would like to pre save the first filter and search on filtered store only.