如何在Extjs grid.panel中显示数据 [英] How to show data in Extjs grid.panel
本文介绍了如何在Extjs grid.panel中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是初始化我的视图的正确方法吗?
我有这样的代码:
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?
推荐答案
- 你应该把
this.callParent在您的视图呈现时,您可以自动载入商店或调用load()函数。
$ b在initComponent方法中, $ b
- 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
或
//view config
listeners: {
render: function(){
this.store.load();
}
}
您还需要配置列。
查看完整的工作示例: http://docs.sencha.com/ext-js/4-0/#!/example/grid/array-grid.html
这篇关于如何在Extjs grid.panel中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文