views:

34

answers:

1

Hi, i've some Ext.FormPanel and i want to enable the "Save" button only when the user changes the values inside the form. How can i discover that the user changed some fields ?

I've tried with form.on("change"), SelectionMode but without any success.

Thanks

+1  A: 

Simply check

var myFormPanel = // get a reference to the form panel
if (myFormPanel.getForm().isDirty()) {
    // submit your form
}

in your click-handler on the "Save"-button.

Stefan Gehrig
Huge thanks! i known that Ext had some elegant solution for this! I've founded that i have to set trackResetOnLoad:true on the form to make it works correctly - Thanks again
wezzy