入门级的例子,只是就显示一行,大家帮忙看下。
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
});