DelphiFAQ Home Search:
General :: Web publishing :: JavaScript :: ExtJS


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Handling dirty (modified) text input fields in ExtJS


I am working with ExtJS - how can I detect if a field has been modified in a dynamic form? I have a master table and a detail panel where I show details for the selected record in the master table.


You can check if the entire panel or individual fields are empty by querying the isDirty() function.

But when the changes have been saved, you may want to reset this flag. I found that there is some method clearDirty() and a related flag trackResetOnLoad but I could not make it work.

After some experimenting, I wrote my own resetDirty() function - see below. I call it after modified text values have been saved back to the database.

function resetDirty(field) {
         field.originalValue = field.getRawValue();

Generated 12:01:41 on Apr 1, 2020