DelphiFAQ Home Search:

Handling dirty (modified) text input fields in ExtJS

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

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.

Answer:

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();
}

Comments:

2009-01-27, 08:53:46
anonymous from Netherlands  
thx this helped

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: