PDA

View Full Version : [CLOSED] Formpanel Button: Disable auto submit



extnetuser
Apr 11, 2013, 1:31 PM
Hi,

I have a formpanel containing some fields and a button with a direct click event. My intention is to submit only the changed field values via JSON:


@(Html.X().Button()
.Text("Save")
.DirectEvents(e =>
{
e.Click.Url = Url.Action("SaveForm", "Form");
e.Click.ExtraParams.Add(new Ext.Net.Parameter("formData", "Ext.encode(Ext.getCmp("MyFormPanel").getForm().getValues(false, true))", ParameterMode.Raw));
})
)

However, as stated somewhere else (http://forums.ext.net/showthread.php?2351-CLOSED-Submit-FormPanel-values-via-AjaxEvent) all field values get submitted as additional post parameter automatically. Is there a way to disable this behaviour somehow?

Daniil
Apr 11, 2013, 4:43 PM
Hi @extnetuser,

Please change the default DirectEvent's Submit Type to Load.

e.Click.Type = DirectEventType.Load

extnetuser
Apr 11, 2013, 4:57 PM
Thank you Daniil. Thread can be marked as solved.