{success:true,'totalCounts':405,result:[["L110700009","朱诚","朱诚",40061,"Winson Hon",20,"gouge","","4","[email protected]",1,"","27062"],["L110700008","rr","rr",48127,"苟吕斌",10,"w","","23423423","[email protected]",1,"sdfsddf","88894"],["L110700007","朱诚","朱诚",40061,"Winson Hon",10,"gouge","","4","[email protected]",1,"sdf","27062"]}这是我的json字符串 this.store = new Ext.data.Store( {
proxy : new Ext.data.HttpProxy( {
url : __ctxPath + "/sales/listLead.do"
}),
reader : new Ext.data.JsonReader( {
root : "result",
totalProperty : "totalCounts",
fields : [ {
name : "leadId",
type : "int"
}, "LeadNO", "CustomerCNName",
"CustomerENName","customerId",
"customerManager",
"WinChance",
"KeyPerson",
"KeyFax",
"KeyTEL",
"KeyEmail",
"Status",
"Re",
"customerNo"
]
}),
remoteSort : true
});上面是我的extjs页面部分代码为什么页面不能显示数据 该如何做
主要是我一条记录对应了2个对象
求高手解答 有分分 我的qq247634091
proxy : new Ext.data.HttpProxy( {
url : __ctxPath + "/sales/listLead.do"
}),
reader : new Ext.data.JsonReader( {
root : "result",
totalProperty : "totalCounts",
fields : [ {
name : "leadId",
type : "int"
}, "LeadNO", "CustomerCNName",
"CustomerENName","customerId",
"customerManager",
"WinChance",
"KeyPerson",
"KeyFax",
"KeyTEL",
"KeyEmail",
"Status",
"Re",
"customerNo"
]
}),
remoteSort : true
});上面是我的extjs页面部分代码为什么页面不能显示数据 该如何做
主要是我一条记录对应了2个对象
求高手解答 有分分 我的qq247634091
事件已经响应了?
你的store有没有call load 还有就是render
proxy : new Ext.data.HttpProxy( {
url : __ctxPath + "/sales/listByRoleQuotation.do"
}),
reader : new Ext.data.JsonReader( {
root : "result",
totalProperty : "totalCounts",
fields : [ {
name : "quotationID",
type : "int",
mapping : 0
}, {name : "quotationNO", mapping : 0['quotationNO']},
{name : "quotationName", mapping : 0},
{name : "customerENName", mapping : 0},
{name : "customerCNName", mapping : 0},
{name : "LeadNO", mapping : 0},
{name : "winChance", mapping : 0},
{name : "estimateDLDate", mapping : 0},
{name : "totalAmount", mapping : 0},
{name : "customerNo", mapping : 1}
]
}),
remoteSort : true
});
这是我的store 其实我的json数据就是
{success:true,'totalCounts':405,result:[[{a对象},{b对象}],[{a对象},{b对象}],[{a对象},{b对象}],[{a对象},{b对象}]]}我想对应映射 拿到a对象和b对象的值 但是 页面不知道怎么写 显示不出数据
json 的格式是 属性:'对应的值'
var jsonStr = {
success : true,
'totalCounts' : 405,
result : [
["L110700009", "朱诚", "朱诚", 40061, "Winson Hon", 20, "gouge", "",
"4", "[email protected]", 1, "", "27062"],
["L110700008", "rr", "rr", 48127, "苟吕斌", 10, "w", "", "23423423",
"[email protected]", 1, "sdfsddf", "88894"],
["L110700007", "朱诚", "朱诚", 40061, "Winson Hon", 10, "gouge", "",
"4", "[email protected]", 1, "sdf", "27062"]]
}
楼主,你的json串 少了个“]” 好好检查下,你是手写拼接的吧,注意点
{success:true,'totalCounts':405,result:[[{a对象},{b对象}],[{a对象},{b对象}],[{a对象},{b对象}],[{a对象},{b对象}]]} 这样的数据 该如何解析
var record = Ext.data.Record.create([{
name : 'mbCode'
}, {
name : 'mbName'
}, {
name : 'mbNr'
}, {
name : 'mbSl'
}, {
name : 'sjdxmbLb.mbName'
}, {
name : 'sjdxmbLb.dxmbId'
}]); var reader = new Ext.data.JsonReader({
totalProperty : 'total',
root : 'dxmbList'
}, record); var store = new Ext.data.Store({
url :ctxPath+'/jcsj/dxmb/getAlldxmbAction.do',
reader : reader
});
单个取值如下:
Ext.Ajax.request({
url : ctxPath + '/gwgl/gwlx/findAllGwlxAction.do',
async : false,// 同步请求
success : function(response) {
var jsondoc = new Ext.util.JSON.decode(response.responseText);
reader = new Ext.data.JsonReader({
totalProperty : 'total',
root : 'gwlxs'
}, new Ext.data.Record.create([{
name : 'lxBh'
}, {
name : 'lxMc'
}]));
var proxy = new Ext.data.MemoryProxy(jsondoc);
stored = new Ext.data.Store({
proxy : proxy,
reader : reader
});
stored.load();
fwlxComb = stored;
}
});