PDA

View Full Version : Bug in Ext.form.FieldContainer?



jason.a
29 Oct 2012, 6:52 AM
I'm trying to make a custom type in a grid, called VectorXYZ. So I place 3 number fields together in a single container.

All is well, unless while you're editing, you want to hit enter to commit, or if you click the mouse outside the grid. In the container, or outside the window, bad things happen.

To reproduce the problem, click to edit the VectorXYZ, then click outside the grid. To see how it should behave you can test the same thing with the other example fields.

http://jsfiddle.net/JGAndersen/Jpaxw/1/

jason.a
30 Oct 2012, 11:19 AM
So far I've got a fix that handles about everything except the keyboard properly.

http://jsfiddle.net/JGAndersen/Jpaxw/14/ (http://jsfiddle.net/JGAndersen/Jpaxw/14/)

it watches for blur events on the individual components. It relays a blur event, only when none of the child components are selected... (which causes the editor to close).

there's also a bit of code to force the first child component to have focus on editor activation, so there's no way to miss any of the blur events.

Hopefully this is useful to anyone who wants to us the form.fieldcontainer in their own property grid.

D795
22 May 2014, 12:57 PM
Thanks a lot for this example, I'm trying to do exactly the same.