当前位置: 代码迷 >> Ajax >> GridPanel只好显示一行数据
  详细解决方案

GridPanel只好显示一行数据

热度:184   发布时间:2012-12-31 11:57:51.0
GridPanel只能显示一行数据
入门级的例子,只是就显示一行,大家帮忙看下。

Ext.BLANK_IMAGE_URL="../../ext/resources/images/default/s.gif";
Ext.onReady(function(){
var cm = new Ext.grid.ColumnModel([
{header:"id",dataIndex:"id"},
{header:"姓名",dataIndex:"name"},
{header:"email",dataIndex:"email"},
{header:"性别",dataIndex:"sex"},
{header:"年龄",dataIndex:"age"}
]);
var fields = ["id","name","email","sex","age"];
var data = [["1","JIm","cc@msn.com","0","22"],["2","Naha","blue@msn.com","1","23"]];
var store = new Ext.data.SimpleStore({
fields:fields,
data:data
});
var grid = new Ext.grid.GridPanel({
cm:cm,
store:store
});
grid.render(Ext.getBody());
});

------解决方案--------------------
加个高度就好了
var grid = new Ext.grid.GridPanel({
        cm:cm,
        height:300,
        store:store
    });