wezzy
wezzy

Reputation: 5935

How to discover if an Ext.FormPanel is changed

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.

Upvotes: 0

Views: 2173

Answers (1)

Stefan Gehrig
Stefan Gehrig

Reputation: 83632

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.

Upvotes: 2

Related Questions