GuangShow 2010-08-16 15:40
浏览 358
已采纳

(Ext)从后台查询出的Json格式数据在Ext前端不能显示

刚接触Ext不久,现要用Ext Grid的分页,但是从后台取出的Json数据在js里就是不显示。帮忙看下

我的这个账号是刚注册的 没多少分了 都压上了

代码如下:

js代码:

var cm_sub_user = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), {
header : '手机号码',
width : 150,
dataIndex : 'mobile',
sortable : true
},{
header : '机主名',
width : 100,
dataIndex : 'owner',
sortable : true
}, {
header : '城市编号',
width : 100,
dataIndex : 'city_code',
sortable : true
}, {
header : '软件版本号',
width : 100,
dataIndex : 'ver',
sortable : true
}, {
header : '服务地址',
width : 200,
dataIndex : 'svc1',
sortable : true
}, {
header : '创建日期',
id : 'create_date',
dataIndex : 'create_date',
renderer : Ext.util.Format.dateRenderer('m/d/Y H:i:s'),
sortable : true
}]);

cm_sub_user.defaultSortable = true;

var text_search_company = new Ext.form.TextField({
name : 'pageData.userMobile',
width : 200,
emptyText : '请输入手机号码查询!',
listeners : {
'specialkey' : function(field, e) {
if (e.getKey() == Ext.EventObject.ENTER) {
searchCompany();
}
}
}
});

// grid的查找方法
var searchCompany = function() {
ds_sub_user.load({params : {start : 0, limit : 20}});
};

var btn_search_company = new Ext.Button({
text : '查询',
iconCls : 'icon-search',
handler : searchCompany
});

var ds_sub_user = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : 'UserManageAction_findSubUserByPageCondition.action'
}),
reader : new Ext.data.JsonReader({
totalProperty : 'totalProperty',
root : 'jsonOperatorList'
}, [{
name : 'mobile',
type : 'string'
}, {
name : 'owner',
type : 'string'
}, {
name : 'city_code',
type : 'string'
}, {
name : 'ver',
type : 'string'
}, {
name : 'svc1',
type : 'string'
}, {
name : 'create_date',
type : 'date',

dateFormat : 'Y-m-d H:i:s'
}])
});

var grid_sub_user = new Ext.grid.EditorGridPanel({
title : '终端用户管理',
iconCls : 'icon-grid',
loadMask : {msg : '数据加载中...'},
region : 'center',
cm : cm_sub_user,
ds : ds_sub_user,
sm : new Ext.grid.RowSelectionModel({singleSelect : true}),
enableColumnMove : false,
trackMouseOver : false,
frame : true,
autoExpandColumn : 'create_date',
clicksToEdit : 1,
tbar : [text_search_company, btn_search_company],
bbar : new Ext.PagingToolbar({
pageSize : 20,
store : ds_sub_user,
displayInfo : true,
displayMsg : '第 {0} - {1} 条 共 {2} 条',
emptyMsg : "没有记录"
})
});

具体后台Json的格式是什么样子的?

我后台的json格式是这样的:

{totalProperty=2, jsonOperatorList=[{"mobile":"15094304697","password":"123456","owner":"服务器","city_code":"025","ver":"3.0","svc1":"www.baidu.com","svc2":null,"plat_md5":"12","plat_no":"15852020123","call_no1":"15852320458","call_no2":null,"call_no3":null,"call_no4":null,"shd_md5":"12","shd_conf_status":"1","all_md5":"123456","create_date":"2010-08-16 00:00:00","rn":1},{"mobile":"15852324369","password":"100000","owner":"交换机","city_code":"025","ver":"0.8","svc1":"www.google.cn","svc2":null,"plat_md5":"12","plat_no":"15094320157","call_no1":"15623015483","call_no2":null,"call_no3":null,"call_no4":null,"shd_md5":"34","shd_conf_status":"2","all_md5":"158231","create_date":"2010-08-16 00:00:00","rn":2}]}

  • 写回答

2条回答

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?