开发者

ExtJs. Easyest way to show empty grid

I'm using ExtJs 4. I have a grid, but i don't have a store or columns pre defined. 开发者_如何学运维I just don't know what grid should be showing. But i still nead to render grid using Json markup.

I want to do something like this:

//grid with empty store and no collumns
{ 
    xtype: 'grid',
    columns: [],
    store: new ArrayStore([])
}

What is the easyest way to do this?


You can't load create a grid without any columns.. however you can create one without any data (just set store to autoload: false). For example..

{
   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: ' ' }
     ]
   })
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜