求牛人帮助:extjs4.0 grid返回值可以得到但不显示数据
Ext.onReady(function(){
// create the Data Store
var store = new Ext.data.JsonStore({
totalProperty: 'totalProperty',
root: 'root',
idProperty: 'threadid',
remoteSort: true,
fields: ['dwdah', 'dwsbh', 'khDate', 'khUserId','userDog','userId','userJb','userName','userPassword','waptel','xgDate','yxqQ','yxqZ'],
proxy: new Ext.data.HttpProxy({
url:'user.do?code=list',
method:'post'
})
});
var grid = new Ext.grid.GridPanel({
//width:850,
height:450,
title:'本系统用户信息列表',
store: store,
trackMouseOver:false,
disableSelection:true,
loadMask: true,
trackMouseOver:true,
loadMask: {msg:'正在加载数据,请稍侯……'},
// grid columns
columns:[{
header: '编号',
dataIndex: 'dwdah',
width: 220,
sortable: true
},{
header: '姓名',
dataIndex: 'dwsbh',
width: 100,
sortable: true
},{
header: '开户日期',
dataIndex: 'khDate',
width: 70,
align: 'right',
sortable: true
},{
header: '单位识别号',
dataIndex: 'khUserId',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'userDog',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'userId',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'userJb',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'userName',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'userPassword',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'waptel',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'xgDate',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'yxqQ',
width: 150,
sortable: true
},{
header: '单位识别号',
dataIndex: 'yxqZ',
width: 150,
sortable: true
}],
// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize:5,
store: store,
displayInfo: true,
displayMsg: '显示第{0}数据到{1},一共有{2}条',
emptyMsg: "没有记录",
items:[
'-', {
pressed: true,
enableToggle:true,
text: 'Show Preview',
cls: 'x-btn-text-icon details',
toggleHandler: function(btn, pressed){
var view = grid.getView();
view.showPreview = pressed;
view.refresh();
}
}]
})
});
// render it
grid.render('gridview');
// trigger the data store load
store.load({params:{start:0, limit:5}});
alert(store.getCount());
}); java?extjs
[解决办法]
是不是绑定head的名字错了? 这玩意儿很恶心的
[解决办法]
把你返回的json数据贴出来看看。又可能是那里面的问题。
[解决办法]
按照你贴的代码。改了下数据源。显示正常。没有出现什么问题。