【发布时间】:2013-10-11 01:38:25
【问题描述】:
我想使用 JSON.stringify 方法将 slickgrid 组数据转换为文本并发布到服务器。但是由于 JSON 对象是循环结构,它不起作用:
我使用的代码如下:
grps=JSON.stringify(dataView.getGroups()));
到目前为止,我有什么替代方法可以在当前数据视图中捕获 json 结果或对 getGroups() 对象进行字符串化?
我设法通过
获取dataView的项目$.each(ar,function(index,value){
db+=JSON.stringify(dataView.getItemById(value))+",";
//db.push(dataView.getItemById(value));
//console.log("row item: " + value+",data:"+JSON.stringify(dataView.getItemById(value)));
});
但这不是我想要的结果,因为它没有反映 json 字符串中的嵌套组结构。
感谢帮助
【问题讨论】:
标签: jquery json slickgrid dataview