【发布时间】:2018-10-16 08:20:23
【问题描述】:
我创建了一个迷你 EXTJS 应用程序,定义了模型、商店和网格。我已验证商店正在运行,因为我可以使用 Chrome 调试工具创建实例并查看数据。但是,当我尝试在网格中显示数据时,它永远不会显示。
这里是 app.js 的代码:
Ext.application({
launch: function () {
Ext.define('Companies', {
extend: 'Ext.data.Model',
fields: ['id', 'link', 'name']
});
Ext.define('CompaniesStore', {
extend: 'Ext.data.Store',
model: 'Companies',
storeId: 'cStore',
autoLoad: true,
proxy: {
type: 'rest',
url: 'http://corky52547.somee.com/Service1.svc/Companies'
}
});
Ext.create('Ext.container.Viewport', {
name : "viewPort2",
layout: 'fit',
renderTo: Ext.getBody(),
items: [
{
title: 'Bill Reminder Web'
},
{
xtype: 'grid',
title: 'Bills',
height: 100,
width: 100,
columns: [
{text: 'ID', width: 100, dataIndex: 'id'},
{text: 'Link', flex: 1, dataIndex: 'link'},
{text: 'Name', width: 200, dataIndex: 'name'}
],
store: Ext.create('CompaniesStore',{})
}
]
});
}
});
更新:
我现在可以显示要显示的数据,但像这样没有主题。如何更新主题?
【问题讨论】: