ChrisR
15 Oct 2007, 6:14 AM
Is there a way i can manipulate the dirty state of a form? I'm currently trying to implement the following scenario
I've got a tree in the west panel, when i click a tree node a form in the center panel gets populated with the selected tree item's data (JSON).
When someone alters some fields and then selects another node without first saving i'm displaying an alert that he needs to save first or else loose his changes. Easy enough with form.isDirty().
Now when he does alter some fields (turning the form dirty) and then saves, the form is still dirty even though it has been successfully saved and thus should be no longer dirty. The the user gets the alert again even though he already succesfully saved his changes.
how can i update the dirty state to false after the form has been saved?
I've got a tree in the west panel, when i click a tree node a form in the center panel gets populated with the selected tree item's data (JSON).
When someone alters some fields and then selects another node without first saving i'm displaying an alert that he needs to save first or else loose his changes. Easy enough with form.isDirty().
Now when he does alter some fields (turning the form dirty) and then saves, the form is still dirty even though it has been successfully saved and thus should be no longer dirty. The the user gets the alert again even though he already succesfully saved his changes.
how can i update the dirty state to false after the form has been saved?