PDA

View Full Version : Updating Grid based on Combo box selection



sencha_cool
8 Aug 2012, 7:50 PM
newbie started with some examples in sencha involving manipulation of grid based on combo box selection.

any utility methods manipulating store based on combo box selection.

any help how to go about...

Thanks

johanhaest
8 Aug 2012, 11:44 PM
If you mean like filtering your grid, we mostly just give an extra param to the store proxy and reload it.



var store = grid.getStore();
store.getProxy().extraParams.comboFilter = your_combo_value;
store.load();

FoxMulder900
9 Aug 2012, 5:53 AM
If you aren't using paging and all of your data is already in the store, you can also use the store's 'filterBy' function in your combo box 'select' listener.



select: function(combo){
combo.getStore().filterBy(function(record){
//return true if you want this record to be displayed
});
}

sencha_cool
9 Aug 2012, 7:25 AM
store.filterBy option solved the purpose

Thank you