-
8 Dec 2011 4:52 AM #1
Alter form data using the beforesubmit event
Alter form data using the beforesubmit event
According to the documentation of the event beforesubmit in Ext.form.Panel , I should be able to modify the values submitted, but I can't figure out how.
I've tried modifying the variable values, but this has no effect.Implementations may adjust submitted form values or options prior to execution.
Any help is highly appreciated.
Note: I'm basically trying to send a JSON string, so I need to encode the values using JSON.stringify.---
Oussama Mubarak // Semiaddict
-
8 Dec 2011 3:50 PM #2
This looks like a bug. Thanks for the report.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
11 Jan 2012 11:29 AM #3
This is working for me, using the following block of code:
This will post: 'name=go&test=hello'Code:var form = Ext.Viewport.add({ xtype: 'formpanel', items: [ { xtype: 'textfield', label: 'one', name: 'name', value: 'go' }, { docked: 'bottom', xtype: 'toolbar', items: [ { xtype: 'button', text: 'submit', handler: function() { form.submit({ method: 'POST', url: 'test' }); } } ] } ], listeners: { beforesubmit: function(form, values, options) { values.test = "hello"; } } });
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.


Reply With Quote