我使用的是ExtJS 4.0.7,我正在使用JSON Store将它加载到面板网格。我使用的是Firefox 16.0.2版。这是一个非常简单的例子,我可以运行Array网格。使用JsonStore的ExtJS 4面板网格不加载网格
Ext.onReady(function() {
var Grid1Store = new Ext.data.JsonStore({
root: 'users',
fields: [ 'id', 'name', 'email' ],
autoLoad: true,
data: { users: [
{ "id": 1, "name":"John Smith", "email":"[email protected]"},
{ "id": 2, "name":"Anna Smith", "email":"[email protected]"},
{ "id": 3, "name":"Peter Smith", "email":"[email protected]"},
{ "id": 4, "name":"Tom Smith", "email":"[email protected]"},
{ "id": 5, "name":"Andy Smith", "email":"[email protected]"},
{ "id": 6, "name":"Nick Smith", "email":"[email protected]"}
]}
});
var Grid1Grid = new Ext.grid.GridPanel({
store: Grid1Store,
renderTo: 'grid-example',
title: 'Target',
width: 300,
columns: [
{
id: 'name',
header: "Name",
sortable: true,
dataIndex: 'name'
},{
id: 'email',
header: "Email",
sortable: true,
dataIndex: 'email'
}
]
});
});
表格正在加载并且没有数据显示。它显示一个空格。我不确定这个问题。是否由于某些浏览器兼容性问题?
嗨,欢迎来到StackOverflow。如果你想获得有用的答案,最好是更具体地了解你想知道的内容。 “请检查是否有问题”不是一个问题。 –