-
5 May 2009 5:16 PM #1
Submit button error
Submit button error
This submit button won't work and I can't figure out why..?
Should be simple shouldn't it? What could it be?Code:{ text: 'Submit', handler: function () { app.elements.grid.commitChanges(app.elements.mainWindow.getForm()); method: 'POST'; action: 'test.php'; } }
-
5 May 2009 6:43 PM #2
For starters, you should read the API. Your mixing and matching options that don't belong.
Your button handler() should be calling your form's submit().
http://extjs.com/deploy/dev/docs/?cl...&member=submit
Submit options
http://extjs.com/deploy/dev/docs/?cl...ember=doAction
-
5 May 2009 7:04 PM #3
Thanks new2ext, however I don't quite understand what you are saying.
Should I do this?
Please tell me what I'm doing wrongCode:{ text: 'Submit', handler: function () { myFormPanel.getForm().submit({ app.elements.grid.commitChanges(app.elements.mainWindow.getForm()); method: 'POST'; action: 'test.php'; } } }
Much appreciated.
-
5 May 2009 8:02 PM #4
Look at your code and ask your self what each line does.
Use the API. The submit() accepts the following optionsCode:{ text: 'Submit', handler: function () { myFormPanel.getForm().submit({ app.elements.grid.commitChanges(app.elements.mainWindow.getForm()); //Why do you have this? method: 'POST'; action: 'test.php'; //Why do you have this? } } }
http://extjs.com/deploy/dev/docs/?cl...ember=doAction- url
- method
- params
- headers
- success
- failure
- scope
- clientValidation
Compare this list to what your using in your code
-
5 May 2009 8:06 PM #5
Thats better, but I don't understand why you are including this line:
If you have a grid that displays data that is saved in the form, you might just want to reload the grid after the form has returned successfully:Code:app.elements.grid.commitChanges(app.elements.mainWindow.getForm());
Cheers,Code:{ text: 'Submit', handler: function () { myFormPanel.getForm().submit({ url: 'test.php', success:function(form,action){ app.elements.grid.reload(); } }); } }
Sabi


Reply With Quote