PDA

View Full Version : Component IsDirty Property always returns true



AJAIN32
21 May 2014, 1:37 AM
Hi All,

I have a form containing 4 comboboxes and i have to check if a user is changing value of some comboxes i need to send only that combox values after submitting.

I have tried to check with combobox's isDirty function but i am facing some issue in that, as i am setting some default values of combobox so the field is always dirty when i load it first tim.

I have tried with one alternative when i am setting default value of combobox after that i am again trying to set the fields dirty flag to false but it is always true :(

var combo = combo.setValue('45') // dummy value
combo.isDirty(false);
but still after that i am getting isDirty 'True' always.

can anybody please tell me how to check that after loading the default field how can we check if the field is changed or not ????
Or is there any way to check with the form that what all fields in the form is updated ??

Thanks in advance,
Ankit

jsakalos
21 May 2014, 2:05 AM
Would this help? http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.Panel-cfg-trackResetOnLoad

AJAIN32
21 May 2014, 2:43 AM
Thanks for the prompt reply,

Can you please tell me how we can use that.

if i do trackResetOnLoad:true on the main form of the component, then how i can set the dirty flag of any component to false.

As mentioned in the docs : If set to true, reset() resets to the last loaded or setValues() data instead of when the form was first created.

setValues i am using after loading the data in the combobox and field is getting dirty. can we revert back to this flag as false ??