我使用的是一个webix数据表。我在映射表的值时遇到了问题。数据没有显示,尽管我知道它看到了数据。
下面是我的webix脚本和我的映射:
webix.ajax().get('urltourltourl',{
// Error callback
error:function(text, data, XmlHttpRequest){
alert("error");
},
//Success callback
success:function(text, data, XmlHttpRequest){
var data = JSON.parse(text);
console.log(data);
var dtable2 = webix.ui({
container:"datatable",
view:"datatable",
map:{
1:data.data[0].centerNumber,
2:data.data[0].centerNumber
},
columns:[
{ id:"1", header:"CenterNBR" , width:88},
{ id:"2", header:"Loan NBR", width:88},
{ id:"3", header:"Cust Name", width:88},
{ id:"4", header:"MTD #", width:88},
{ id:"5", header:"MTD $", width:88},
{ id:"6", header:"MTD %", width:88},
{ id:"7", header:"YTD #", width:88},
{ id:"8", header:"YTD $", width:88},
{ id:"9", header:"YTD %", width:88},
],
autoheight:true,
autowidth:true,
data: data
});
}
});映射应该将该ID与我从data JSON对象中提取的值绑定在一起,但它没有,它只是空白。
发布于 2016-10-05 01:33:55
如果你想使用"map“属性,你需要
map:{ "a1":"#centerNumber#","a2":"#centerNumber#“},列:[{ id:"a1",header:"CenterNBR”,width:88},{ id:"a2",header:"Loan NBR",width:88},
http://webix.com/snippet/115c1e12
如果需要使用数字键,请改用scheme.init
scheme:{
$init:function(obj){
obj[1] = obj.centerNumber;
obj[1] = obj.centerNumber;
}
},http://webix.com/snippet/2d1344bd
https://stackoverflow.com/questions/39857050
复制相似问题