首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

Extjs4.0中grid表格没有数据?解决方法

2012-03-24 
Extjs4.0中grid表格没有数据?[codeJScript][/code]Ext.onReady(function(){Ext.QuickTips.init()Ext.def

Extjs4.0中grid表格没有数据?
[code=JScript][/code]
Ext.onReady(function(){
Ext.QuickTips.init();

Ext.define("user",{
extend : "Ext.data.Model",
fields :[
{name:'name',type:'string',sortable:true},
{name:'age',type:'int',sortable:true},
{name:'email',type:'string',sortable:true}
]

});

var datas = [
['aa',17,'sasas'], ['aa',17,'sasas']
];


Ext.define("users",{
extend:"Ext.data.Store",
model:'user',
storeId :'s_user',
proxy:{
type:'memory',
data:datas,
reader:'array'
},
autoLoad :true
});




Ext.create("Ext.grid.Panel",{
title:"dd",
height:300,
width:500,
frame:true,
forceFit:true,
columns:[
{text:"Name",dataIndex:"name"},
{text:"Age",dataIndex:"age"},
{text:"Email",dataIndex:"email"}
],
store:Ext.data.StoreManager.lookup('s_user'),
renderTo: Ext.getBody(),
multiSelect:true,
selType: 'checkboxmodel'
});

});


有表格出现就是表格中没有数据,求赐教!!!

[解决办法]
你只是定义了一个新的STORE,并没有生成STORE,你可改为:
//store:Ext.data.StoreManager.lookup('s_user'),
store:Ext.create('users'),

[解决办法]
你ext几的???

HTML code
    {                    xtype: 'gridpanel',                    title: '菜单管理列表',                    id:'cdglgrid',                    autoScroll : true,//                    colspan:1,   //占一列                    store: _cdglStore,                    columns: [                    //设置行号                 Ext.create('Ext.grid.RowNumberer',{text : '序号',align:'center', width : 35}),                    {                        xtype: 'gridcolumn',                        dataIndex: 'name',                        width:250,                        align:'center',                        text: '菜单项名称' 

热点排行