相关链接 : http://blog.csdn.net/gchb9527/article/details/8688279
----------------------------------------------------------------------------------------
//提交按钮,所有验证通过方可提交
$("#saveButton").click(
function() {
var flag = $('#form-wizard').bootstrapValidator(
'validate').data('bootstrapValidator').isValid();
if (flag) {
var allTableData = $('#reportTable1').bootstrapTable('getData');//获取从表表格的所有内容行
// console.log(allTableData);
// $('#applyDeploys').val(JSON.stringify(allTableData));
var models = new Array();
var obj = $('#form-wizard').serializeObject();
/* var s=JSON.stringify(str);
alert(s);
var obj=JSON.parse(s);
obj.applyDeploys=allTableData; */
//添加K-V值
obj.applyDeploys=allTableData;
models.push(obj);
$.post("saveUserDeploy.json",
{
models : JSON.stringify(models)
},
function(result) {
//如果保存不成功的提示 原因addressTip
if (!result.ajaxResultJson.success) {
var warn = result.ajaxResultJson.msg;
if (warn != null) {
$("#addressTip").text(warn).removeClass('state3')
.addClass('alert alert-danger alert-dismissable');
return;
}
} else {
layer.msg(result.ajaxResultJson.msg);
$('#myModal').modal('hide');
$('#cusTable').bootstrapTable('refresh');
layer.msg('保存成功', {
icon : 6
});
}
});
}
});