首页 新闻 会员 周边

web前端 JSON类型数据操作

0
悬赏园豆:30 [已关闭问题] 关闭于 2014-04-23 16:41

//方法体

var selectRowsX = $('#table').datagrid(
'getSelections');
var selectRowsY = $('#table').datagrid(
'getSelections');
var isGD=false;
for ( var i = 0; i < selectRowsX.length; i++) {
if (selectRowsX[i].DZGD != '0') {
isGD=false;
alert("第" + (i + 1) + "行 "
+ selectRowsX[i].wjtm
+ '电子已归档');
break;
} else {
selectRowsX[i].DZGD='1';
isGD=true;
delete selectRowsY[i].DZGD;//删除DZGD
delete selectRowsY[i].ZZGD;//删除ZZGD
delete selectRowsY[i].SFZJ;//删除SFZJ
}

}
if(isGD){
var JSONdataX = JSON
.stringify(selectRowsX);

var JSONdataY = JSON
.stringify(selectRowsY);

alert(selectRowsX[0].DZGD);//输出第一行数据的DZGD属性

alert(JSONdataX )

alert(JSONdataY )

输出 DZGD为未定义的数据类型, JSONdataX 和JSONdataY的值是相同的。请教为什么?

问题补充:

没人,还是问题太简单?呵呵

biu bo的主页 biu bo | 初学一级 | 园豆:147
提问于:2014-04-22 15:28
< >
分享
所有回答(1)
0

代码太难看了,就不能编辑下

最佳损友。 | 园豆:63 (初学一级) | 2014-04-23 10:50
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册