ExtJS 4 Change grid store on the fly

前端 未结 4 1538
佛祖请我去吃肉
佛祖请我去吃肉 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:12

    Abdel Olakara's answer helped me out when I needed to update data on something that didn't have reconfigure (custom class inheriting from Ext.form.FieldSet).

    But you don't need to specify addRecords or the range for getRange, because the defaults have us covered in this case.

    This means you can do:

    myStore = user.products();
    grid.getStore().loadRecords(myStore.getRange());
    

提交回复
热议问题