如何在 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(arguments);
放在 initComponent 方法中 - 您可以在视图呈现时自动加载 store 或在 store 上调用 load().
- 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.
要么:
//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
you also need to configure columns. See full working example: http://docs.sencha.com/ext-js/4-0/#!/example/grid/array-grid.html
这篇关于如何在 Extjs grid.panel 中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文