ajax及模态框

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ajax及模态框相关的知识,希望对你有一定的参考价值。

//修改
$("#eventList").on("click",".btn-edit",function () {
var _id = $(this).parent().data("id");
var model_id = $("#resBox").find(".list-modal").find(".actt").data("id");
var _data = {
id: _id,
model_id : model_id
};
ModifyRecord({
title: "编辑记录",
html: __inline("./content/userUpdate.html"),
callback: function(box){
var _box = box.find("#confirm");
$.ajax({
url: api.configfiledetail,
data: {
id : _id,
model_id :model_id,
},
type: ‘get‘,
dataType: ‘json‘,
success: function(data){
data1 = data;
_box.find("." +fie+"+ ").val(data+"."+" + fie + ");
var form = $("#formModel",parent.document);
var html = "";
if(typeof data != "undefined" && data.data.field !==null && data.data.field.length != 0){
var field = data.data.field;
var datalist = data.data.datalist;
// $.each(field,function (i,fie) {
// html += "<div class="form-group" clear><label data-field="+fie+">"+fie+"</label><div class=‘col-sm-10‘><input type=‘text‘ class=‘form-control‘>"+datalist[O][fie]+"</div></div>";
//
// });
for (var i = 0; i < field.length; i++) {
var fie = field[i];
var listStr = datalist[fie];
if ("undefined" == typeof(listStr)) {
listStr = "";
}
html += "<div class=‘form-group forms clear‘><label class=‘control-label‘ style=‘margin-top: 10px‘ data-field=" + fie + ">" + fie + "</label><div class=‘controls ‘><input type=‘text‘ class=‘form-control " +fie+ "‘ data-field=" + fie + " value=‘" + listStr + "‘></div></div>";
}

}
form.append(html);
}
});
},
id: _id,
model_id : model_id,
url: api.modifyconfig
});
$(this).attr(‘data-target‘,‘#confirm‘);
});



















































以上是关于ajax及模态框的主要内容,如果未能解决你的问题,请参考以下文章

C# 模态框传值

Bootstrap 模态框强化

使用ajax请求,模态框调用并更改密码

bootstrap下使用模态框,在模态框内输入框中回车时,模态框自动关闭的问题及解决方法

bootstrap中modal框数据不清空,怎么解决

bootstrap模态框怎么传值