js amazui 两种modal
一种使用form,button类型为submit,提交后自动刷新 form<div class="am-modal am-modal-confirm" id="choose_ppa_form" style="top:-10%;"> <div class="am-modal-dialog"> <div class="am-modal-hd" id=''>Choose PPA<br> <font size="2" color="BF2126">Please select the PPA data to be jsfunction edit_parameter(obj){ $('#choose_ppa_form').modal({ relatedTarget: this, onCancel:function(e) { location.reload(); } }) }
|
一种使用modal自定义的方法,confirm时,可以使用ajax post form<div class="am-modal am-modal-confirm" id="choose_ppa_form" style="top:-10%;"> <div class="am-modal-dialog"> <div class="am-modal-hd" id=''>Choose PPA<br> <font size="2" color="BF2126">Please select the PPA data to be jsfunction edit_parameter(obj){ $('#choose_ppa_form').modal({ relatedTarget: this, onConfirm: function(e){ $.ajaxSettings.async=false //sync var arr={'release_ppa_ids':$('#release_ppa_ids').val(),'eid':'{$eid}','edid':'{$edid}'}; $.post("{:U('Admin/Engagement/update_release_flag')}",arr, function(data){ if(data){ console.log('success to update flag!') location.reload(); }else{ alert('Fail to choose ppa data!') return false; } }); }, onCancel:function(e) { return false; } }) }
|