javascript - Extjs form submit -


I searched for hours and hours for the solution but can not find one I want to present something in a php API function This looks like this:

  / * global extensions: wrong * / ext.onReady (function () {var i = 0; var form = Ext.create ('Ext.form. Item: [{fieldLabel: 'base_entity_id', name: 'first', allow box: wrong}], button: 'Title:', 'Title:', 'title_' [{Text: 'reset', handler: function () {this.up ('form'). GetForm () reset ();}}, {text: 'submit', formBind: true, // Only enabled after the first form is enabled: Correct handler: function () {var form = this.up ('form') GetForm ();}}},}) var tab = Ext.create ('Ext.tab Person: [[Title: 'Home', Margin: 40, Item: 'Tab', ID: 'Tab', Item ID: 'Tabs', Full Screen: True, Renderer Document. [Form],}, {title: 'result', item id: 'result', listener: {active: function (tab) {if (i == 0) {var panel = Ext.create ('Ext.tab .Panel ', {id:' tab2 ', width: window, height: window, render: document. Commodity items: [{title: '1', Item ID: "1", off to qualify: true, Html: "L0329u9iwsfoiahfahfosaofhasohflhsalkfhoihoi3riwoifhoiashfkhasofhosahfsa Hfahsfosafoisaiohfaoishfoihsaoifasoifsaifhsaoifasoihfoiahsfoihasfoihasoifoisfoihsafoihasfoiasoihasfoihaoifhaoihfoiahfoiaoafoafoiafsaoafohaoh"}, {title: '2', Item ID: '2', able to close : True,}]}) tab.add (panel); Tab.doLayout (); I = 1; }}}}}}}  

});

But when I am submitting I can not find any answer, can anyone help me with this? I do not know what the next steps are ...

OK, you have a URL Not set, and submit is not a submission method, so I'm not sure how this should work.

You will need to add your url config form:

  Ext.create ('Ext.form.Panel', {title: 'Base_entity_id', method: 'POST', url: 'myBackEnd.php' // or whatever destination you are using for your backend. ...}); In addition to this, I have noticed that you are using  formbind: true  and checking whether the form was valid, one action other Offers unnecessary, so choose one, there is no need for both! 

Add it to your button handler:

  form.submit ({params: {id: form.getForm (.) GetValues ​​(). First}, success: Function (form, action) {Ext.Msg.alert ('success', 'your form was successfully submitted')}}, failure: function (form, action) {Ext.Msg.alert ('failed', action Results: action results. Message: 'no response');}});  

Then you should check for form code and more information about the configuration for $ _ POST ['id']

Check this document for:


Comments