开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜