- 注册时间
- 2014-6-5
- 最后登录
- 2015-7-17
- 阅读权限
- 10
- 积分
- 200
- 精华
- 0
- 帖子
- 59
|
这是我表单的
{"noticeCode":"","noticeName":"","senderDeptCode":"","createDate":""}
这是我的表格
[{"noticeCode":"1","noticeDtlCode":"1","mpitemId":"1","unit":"1","remark":"1","lineDirect":"1","stake":1,"laneNum":"1","dssType":"1","dssDesc":"1","dssAmount":1,"mpitemAccount":1,"dssPhoto":"1"}]
第一个我可以解析出来。但这个表格传到后台没办法用json解析。大神看看这个怎么处理。我前台写的不对还是怎么样。我的js
为什么就多了【】 这个东西。我是获取的不对吗》还是用方法用错了
function saveData(){
// 工程条目表单数据
var o = form.getData();
form.validate();
if (form.isValid() == false) return;
//json
//var json = mini.decode (o);
var detailGrid = grid.getData();
for(var i = 0; i < detailGrid.length; i++)
{
delete detailGrid[i]._id;
delete detailGrid[i]._uid;
}
var json =[];
json.push(mini.encode(o));
json.push(mini.encode(detailGrid));
$.ajax({
url: basePath+"mems/dm/saveNotice",
type: 'POST',
dataType:"json",
cache: false,
data : JSON.stringify(json),
beforeSend: function(x) {
x.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
},
success: function (text) {
alert(text);
//closeWindow("save");
},
error: function (jqXHR, textStatus, errorThrown) {
//mini.alert(jqXHR.responseText);
//closeWindow();
}
});
}
|
|