How to show data in Extjs grid.panel

妖精的绣舞 提交于 2019-12-08 09:21:37

问题


Is this the correct way to initialize my view? I have this code:

Ext.define('AS.view.View', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.view',
    store: 'Store',

    initComponent: function () {}
});

The store is configured on the grid, shouldn't I see data?. Can someone help me?


回答1:


  1. You should put this.callParent(arguments); in the initComponent method
  2. You can either autoload the store or call load() on the store when your view renders.

Either:

//store config
autoLoad: true

or

//view config
listeners: {
   render: function(){
       this.store.load();
   }
}

you also need to configure columns. See full working example: http://docs.sencha.com/ext-js/4-0/#!/example/grid/array-grid.html



来源:https://stackoverflow.com/questions/9477274/how-to-show-data-in-extjs-grid-panel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!