【发布时间】:2015-05-15 08:36:17
【问题描述】:
我有一个来自服务器的 JSON 响应,我正在尝试绑定到 JQgrid。但是,响应是一个 JSON 字符串,具有“点”作为对象名称的一部分。我无法让 JQGrid 使用“点”
这是我面临的问题的示例小提琴http://jsfiddle.net/sharathchandramg/rpdfrb0L/2/
$("#grid").jqGrid({
data: data,
datatype: "local",
height: 250,
colNames: ['Name', 'Cluster', 'Location'],
colModel: [{
name: 'name',
width: 120
}, {
name: 'metrics.cluster.first.value',
width: 60,
jsonmap: function (obj) {
return obj.metrics['cluster.first'].value
}
}, {
name: 'metrics.location-latitude.value',
width: 60
}, ],
caption: "Example"
});
如小提琴所示,即使在使用 jsonmap 时,我也无法绑定属性“cluster.first”。而如果属性名称是“位置纬度”,则网格可以正常工作。
让我知道我做错了什么。
【问题讨论】:
-
你可以发布模型数据吗?
-
小提琴链接有我用于测试的示例模拟数据
标签: javascript jqgrid