问题
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:
- You should put
this.callParent(arguments);
in the initComponent method - 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