ExtJS 4 Change grid store on the fly

前端 未结 4 1454
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 09:54

Is it posible to change grid\'s store in ExtJS 4?

For example, i have two models:

User = Ext.define(\'User\',{
  extend: \'Ext.data.Model\',
  [...],
  h         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-31 10:15

    If you want to attach a store to a grid after the grid has been created, you can use the bindStore() method.

    var store = user.products();
    grid.getView().bindStore(store);
    

    Alternatively you can also use load(), loadData(), loadRecords() methods, and copy the data into your store.

提交回复
热议问题