How to pass an id parameter to grid (from a callbck) in ext js so that I'll be able to get only one output?
I have this and I can see tha开发者_开发技巧t I can get the ID that I want but I don't know how to pass it to he grid panel, so that the grid panel will only show that unique row.
callback : function(a,b,c){
console.log(Ext.decode(c.responseText).root);
console.log(Ext.decode(c.responseText).root[0].ID);
grid.getStore().reload();
}
You are probably looking for grid.getStore().filterBy(...)
grid.getStore().filterBy(function(rec, id){
//your logic here. probably something like
//if(id===id_of_row_to_include) return true; else return false;
});
Use this after your store has loaded.
精彩评论