2014年5月22日星期四

Easy UI can only be submitted once, to prevent duplicate submission.

 This post last edited by the u011702993 on 2014-05-19 14:11:31



The question now is if you click on the OK button when a couple of consecutive points will be submitted twice .

How to let him submit only once ?


$('<div id="sysAdmin_merchant_addDialog"/>').dialog({
title: '<span style="color:#157FCC;">商户签约</span>',
width: 900,
height:550,
closed: false,
href: '${ctx}/biz/bill/merchant/10411.jsp',
modal: true,
buttons:[{
    id:'confirmation',
    text:'确认',
    disabled:false,
    iconCls:'icon-ok',
    handler:function() {
    $('#sysAdmin_merchant_addForm').form('submit',{
    url:'${ctx}/sysAdmin/merchant_addMerchantInfo.action',
    success:function(data) {

    }
    });
    }    
},{
text:'取消',
iconCls:'icon-cancel',
handler:function() {

}
}],
onClose:function() {

}
});

------ Solution ------------------------------------- after -------
submitted , sets a mask layer , cover the entire page , after the submission is successful, you can hide out .
mask layer can then display the " submission " of information , allowing users to know the data is being processed
------ Solution ----------------- ---------------------------
you add event validation resubmit .
------ For reference only -------------------------------------- -
you want to disable and click on the OK button to submit it!
------ For reference only -------------------------------------- -


write Where ?

not directly disable ah , first he has to determine whether all of the input , as in the following case you can not disable it ah :


------ For reference only ----- ----------------------------------
after successful submit before validation disabled, or set a global flag , then this flag will then submit completed restoration .

------ For reference only ---------------------------------- -----


ask after successful authentication , submit before . What events. I could not find this ah.
------ For reference only ---------------------------------------

  
write Where ?   
  
not directly disable ah , first he has to determine whether all of the input , as in the following case you can not disable it ah :   
  
    

EasyUi the form has a onSubmit method, this is triggered before submit , where disabling the confirmation button , cancel the disabled
------ For reference only in the success method ----- ----------------------------------


ask after successful authentication , submit before . What event
------ For reference only ---------------------------------------

has been resolved , List some of the code :

function sysAdmin_merchant_addFun () {
$ ('
' .) dialog ({
title: ' merchants signed ',
width: 900,
height: 550,
closed: false,
href: '$ {ctx} / biz/bill/merchant/10411.jsp',
modal: ; true,
buttons: [{
text: ' confirm ',
; iconCls: 'icon-ok',
handler: function () {
; var validator = $ ('# sysAdmin_merchant_addForm') form ('validate');.
if (validator) {
$. messager.progress ();
}

$ ('# sysAdmin_merchant_addForm') form ('submit', {
url:. '$ {ctx} / sysAdmin / merchant_addMerchantInfo.action ',
success: function (data) {
; $ messager.progress ('close');.
var result = $ parseJSON (data);
; if (result.sessionExpire) {
; window.location.href = getProjectLocation ();
} else {
if (result.success) {
$ ('# sysAdmin_merchantZK_datagrid') datagrid ('reload');.
$ ('# sysAdmin_merchant_addDialog') dialog ('destroy');.
$. messager.show ({
; title: ' prompt ',
msg: result.msg
});
} else {
;. $ messager.alert (' prompt ', result.msg);
}
}
}
});
} ;
}, {
text: ' cancel ',
iconCls: 'icon -cancel. ',
handler: function () {
$ (' # sysAdmin_merchant_addDialog ') dialog ( 'destroy');
}
}],
onClose: function () {
; $ (this) dialog ('destroy');.
}
});
}

没有评论:

发表评论