15 Mar 2013 10:04 PM #1
[BUG-EXTJS-4.2.0] Item not being removed from form
I have a form with several field containers, inside each field container are a text field and a button. If the button is clicked, the field container is removed from the form. It looks something like the screenshots:
Screen Shot 2013-03-16 at 1.24.56 PM.png
Screen Shot 2013-03-16 at 1.25.17 PM.png
In Extjs 4.1, the formpanel.getForm().getValues() returns only the actual form fields values, whereas in 4.2, even if I removed some fields, it returns all fields values, including those removed.
Here's the minified files to demonstrate this problem:
18 Mar 2013 9:20 AM #2
Has anyone from the Extjs dev team had a chance to take a look at this issue? I need a fix of this problem quickly, otherwise my project release is hanging there because of this issue. Thanks!
19 Mar 2013 7:00 PM #3
Hi Sencha, have you had a chance to figure out when the fixed is likely to be released? If it is a few days, I will wait. If it's a few months, I probably have to get my hands dirty. Dear Sencha, I understand you have your processes of releasing software. However, I'm hoping the iterations of bug fixing/code improvement could be more accessible. I'm not expecting a new version will be released every few days, but in between two releases, more iterations could be possible, I think.
20 Mar 2013 2:01 PM #4
The issue seems to lie in the Ext.container.Monitor code, it doesn't catch that form field that is removed if it wasn't removed directly but rather by having its owner container removed.
A workaround that I'm using for now is the following. Before removing the container that contains the form fields, run:
20 Mar 2013 2:17 PM #5
The reason this works, btw, is because the monitor is watching for form fields being removed from their containers. It misses when a container that contains form fields is removed. But if you just remove each form field from its container first, the monitor catches that and removes the field from its list of fields that it pulls values from
20 Mar 2013 9:01 PM #6
One more question to Sencha:
@dcohn's code works without any problem. However, before I tried @dcohn's code, actually I tried the following code: