700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > html页面怎么弹出模态框 弹出页面 弹出框 $('').modal({});模态框

html页面怎么弹出模态框 弹出页面 弹出框 $('').modal({});模态框

时间:2022-11-12 15:43:04

相关推荐

html页面怎么弹出模态框 弹出页面 弹出框 $('').modal({});模态框

效果图:

自己可以添加内容;

引用:amazeui前端框架:

弹出页面:

XXX

XXX

XXX

XXX

XXX

XXX

XXX

XXX

XXX

XXX

取消

提交

触发按钮:

js:

//按钮触发

function creditApplyAmount(id) {

//页面处理按钮的提交

$('#handle-form-modal-credit').modal({

relatedTarget: this,

closeViaDimmer:false,//点击遮罩层时关闭 Modal

closeOnConfirm:false,//点击确认时不关闭窗口

onConfirm: function(e) {

var apply_amount = $("#creditApplyAmount1").val();

var capital_source = $("#table-item-capital-source").val();

$.ajax({

type:"POST",

// contentType:"application/json", //WebService 会返回Json类型

url:basePath+"credit/updateLoanApplyCredit",

data:

{"id":id,"apply_amount":apply_amount,"capital_source":capital_source},

dataType:"json",

success:function(data){

if(data==1){

$('#handle-form-modal-credit').modal('close');

$("#creditApplyAmount1").val("");

$("#table-item-capital-source option[value='0']

").attr("selected",true);

alert("成功!");

//刷新页面

commitAjax({'url':getDataUrl(),

'param':getQueryCondition()});

}else{

alert("失败!");

}

},

error:function(){

alert("异常");

}

});

},

onCancel: function(e) {

var apply_amount = $("#creditApplyAmount1").val("");

$("#table-item-capital-source option[value='0'] ").attr("selected",true);

//alert('你取消提交了!');

}

});

}

后端代码:

/**

* xxxxx

* @param loanApply

* @param request

* @return

*/

@RequestMapping("/updateLoanApplyCredit")

@ResponseBody

public Integer updateLoanApplyCredit(

LoanApply loanApply,

HttpServletRequest request)

{

Integer a = 0;

try {

a = service.updateLoanApplyAmount(loanApply);

BaseController.saveLog(

SecurityUtils.getSubject().getPrincipals().toString(),

DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"),

DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"),

BaseController.getRequestIp(request), "xxxxx",

"xxxxxxx", 1, 1, "");

}

catch (Exception e)

{

BaseController.saveLog(

SecurityUtils.getSubject().getPrincipals().toString(),

DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"),

DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"),

BaseController.getRequestIp(request), "xxxxx",

"xxxxxxx, 0, 1, "");

}

return a;

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。