PDA

View Full Version : Panel.items.reorder not updating the GUI



mjdaly
20 Dec 2010, 7:26 AM
Whenever I call the reorder function on a Panel's items object, the change happens, but the GUI is not updated.

Calling doLayout does not update the GUI.

What should I be calling to make the GUI show the reordered items?

mjdaly
20 Dec 2010, 7:52 AM
The following seems to work, but is it the correct way?

myPanel.items.reorder({0:1});
myPanel.update();
myPanel.doLayout();

dilipzin
11 May 2012, 8:36 AM
This might be a little late for a reply....

I ran into same issue as you, and your suggestion to do an update() on parent does work. I did a little more digging and below is observations:

All layouts except for BoxLayout (and its derived classes hbox and vbox), do not re-render their child components if they are re-arranged among themselves (using items.reorder(map)). All it does is checks if the child's parent el is same as the container's el in isValidParent(). Which would obviously return true, hence the child is not rendered.

Does that sounds like a bug or is an expected behavior?