2013-02-08 4 views
1

У меня есть этот код, но по какой-либо причине он не отправляет форму. Функция submit() не работает. Зачем?Как отправить форму в ExtJS?

function kullaniciPenceresi() 
{ 
    Ext.create('Ext.window.Window', { 
    id: 'kullaniciEditWin', 
    iconCls: 'icon-user--pencil', 
    animateTarget: Ext.getCmp("kullaniciDuzenleButonu"), 
    title: 'Kullanıcı Düzenle', 
    modal: true, 
    items: { // Let's put an empty grid in just to illustrate fit layout 

     bodyPadding: 5, 
     width: 350, 

     // The form will submit an AJAX request to this URL when submitted 
     url: 'php/post_data.php?yol=kullanici_formu', 

     // Fields will be arranged vertically, stretched to full width 
     layout: 'anchor', 
     defaults: { 
      anchor: '100%' 
     }, 

     // The fields 
     defaultType: 'textfield', 
     xtype: "form", 
     id: "kullaniciformu", 
     items: [ 

      { 
       xtype:'fieldset', 
            layout: 'anchor', 
      defaults: { 
       anchor: '100%' 
      }, 
       title: 'Hesap Bilgileri', 
       defaultType: 'textfield', 
       items:[ 
        { 
         fieldLabel: 'Şirket', 
         name: 'OrganizationName', 
         allowBlank: false 
        }, 

        { 
         fieldLabel: 'Email', 
         name: 'Email', 
         vtype: "email", 
         allowBlank: false 
        }, 

        { 
         fieldLabel: 'Şifre', 
         name: 'sifre', 
         vtype: "password", 
         disabled: true 
        }, 

        { 
         fieldLabel: 'GrupName', 
         name: 'first', 
         allowBlank: false, 
         xtype: "combo", 

         displayField: 'name', 
         valueField: 'name', 
         store: store, 
         queryMode: 'local', 
         typeAhead: true 
        }, 
        { 
         xtype: 'buttongroup', 
         items: [ 
          {text: 'Yetkilendirme: '}, 
          {xtype: 'button', text: 'Bina', iconCls: 'building', 

      handler: function() { 


       Ext.create('Ext.window.Window', { 
        title: 'Hello', 
        height: 200, 
        modal: true, 
        width: 400, 
        layout: 'fit', 
        items: { // Let's put an empty grid in just to illustrate fit layout 
         xtype: 'grid', 
         border: false, 
         columns: [{header: 'World'}],     // One header just for show. There's no data, 
         store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store 
        } 
       }).show(); 



      } 
          }, 
          {xtype: 'button', text: 'Daire', iconCls: 'building'}, 
          {xtype: 'button', text: 'Cihaz', iconCls: 'counter'} 
         ] 
        }, 


       ] 
     }, 

     { 
      xtype:'fieldset', 
      title: 'Kişisel Bilgiler', 
      defaultType: 'textfield', 
      layout: 'anchor', 
      defaults: { 
       anchor: '100%' 
      }, 
      items:[ 


     { 
      fieldLabel: 'Ad', 
      name: 'FullName', 
      allowBlank: false 
     }, 


     { 
      fieldLabel: 'Telefon', 
      name: 'phone', 
      allowBlank: true 
     }] 
     }] 


     }, 

     buttons: [{ 
      text: 'Save', 
      handler: function() { 
       Ext.getCmp("kullaniciformu").submit(); // <---------------- 
       Ext.getCmp("absolute-panel").load; 
       Ext.getCmp("kullaniciEditWin").close(); 
      } 
     },{ 
      text: 'Cancel', 
      handler: function() { 
       Ext.getCmp("kullaniciEditWin").close(); 
      } 
     }] 
    }).show(); 
} 

Редактировать: Хорошо, я понял, что сейчас. Он не отправляет, если поле группы пуст.

ответ

1

Все поля должны быть заполнены так, чтобы они выполняли отправку POST.

Смежные вопросы