PDA

View Full Version : How to detect user-changes in FormPanel



mfearby
3 Oct 2009, 2:35 AM
Is there a way to easily detect if the user has changed any values in a FormPanel? I've tried searching to see if there's such a thing, but even the API docs lead me to believe I have to write methods to check each field one by one.

Condor
3 Oct 2009, 2:49 AM
So you are looking for:

formPanel.getForm().isDirty()

Animal
3 Oct 2009, 3:04 AM
Or, if it needs to be dynamic and reactive, you could request that form Fields bubble their change events, and listen for change events at the FormPanel level.

mfearby
3 Oct 2009, 4:41 AM
So you are looking for:

formPanel.getForm().isDirty()

Thanks. That does look exactly like what I want. Would you recommend any good books for learning Ext JS? I'm finding the raw API documentation just a little overwhelming. It's hard to figure out exactly what goes with what, and it'd be good to read an excellent book on it all.

I've found "Practical Ext JS Projects with Gears" to be a bit disappointing, not only because I'm running 64-bit Linux, and therefore can't use Gears, but also because the book glosses over each of the widgets and doesn't give enough of an understanding on how each one works. Instead, it focuses on several whole project ideas and has absolutely no Ajax stuff in it. A bad choice, in hindsight.

Animal
3 Oct 2009, 5:51 AM
The "Hide inherited members" button helps a lot when looking for class-specific config options which might help.

Condor
3 Oct 2009, 7:24 AM
Would you recommend any good books for learning Ext JS? I'm finding the raw API documentation just a little overwhelming.

There is Learning Ext JS (http://www.packtpub.com/learning-ext-js/book), which is a good introduction, but doesn't have a lot of detail. I would recommend Ext JS in Action (http://www.manning.com/garcia/) (it's not finished yet, but you can read the finished chapters with early access).

mfearby
3 Oct 2009, 4:42 PM
The "Hide inherited members" button helps a lot when looking for class-specific config options which might help.

Thanks. Didn't notice that little button up there until you pointed it out. That should make a huge difference.


There is Learning Ext JS (http://www.packtpub.com/learning-ext-js/book), which is a good introduction, but doesn't have a lot of detail. I would recommend Ext JS in Action (http://www.manning.com/garcia/) (it's not finished yet, but you can read the finished chapters with early access).

Thanks. Whilst your second recommendation should be a good buy next year when it's finally available, I've just bought an ebook of the first one because even something at its level will be invaluable to get me started.