我正在使用ExtJs4。我有一个网格,但是没有预定义的存储或列。我只是不知道应该显示什么网格。但是我仍然需要使用Json标记来渲染网格。
我想做这样的事情:
//grid with empty store and no collumns
{
xtype: 'grid',
columns: [],
store: new ArrayStore([])
}
最简单的方法是什么?
最佳答案
您无法加载没有任何列的网格。.但是,您可以创建没有任何数据的网格(只需将存储设置为autoload: false
)。例如..
{
xtype: 'grid',
//..other config here
store: new Ext.data.JsonStore({
url: 'store/url.php',
autoLoad: false
}),
cm: new Ext.grid.ColumnModel({
columns: [
{ dataIndex: 'id', header: ' ' }
]
})
}