ext4 Ext.form.Panel 非ajax提交

lzq0107發表於2020-04-07

ext4 非ajax提交方式如下:

 form:Ext.create('Ext.form.Panel',{
   region : 'center',
   border : false,  
  bodyPadding: 20,
  standardSubmit:true,
  defaults : {
    selectOnFocus:true,
    msgTarget: 'side',
    xtype:'textfield',
    maxLength:45,
    allowBlank:false,
    labelAlign : 'right'
    },

   items:[]);

submit按鈕事件如下:

var frm = this.down('form').getForm();
   if(frm.isValid()){
       frm.submit({
                   
url:'j_spring_security_check'
                });
   }

其中最關鍵的屬性是standardSubmit:true。

有關standardSubmit的描述如下:

If set to true, a standard HTML form submit is used instead of a XHR (Ajax) style form submission. Defaults to false. All of the field values, plus any additional params configured via baseParams and/or the options to submit, will be included in the values submitted in the form

相關文章