PDA

View Full Version : removeAll does not work as expected for a Panel with tableLayout



bareflix
23 Nov 2010, 12:36 PM
I have an Ext.Panel with a layout type of table. Initially, it is created correctly, but when I want to update it by replacing it's contents I call panel.removeAll ().
The children are removed, but the rows they were in remain, so when I add the new children there is empty space above them.

Is there a way to reset the layout, or remove all it's generated structure?

--
Chris Bare

plalx
23 Nov 2010, 1:56 PM
Have you tried calling panel.doLayout() ?

bareflix
23 Nov 2010, 1:59 PM
Have you tried calling panel.doLayout() ?

Yes, I call panel.doLayout() after I've added the new elements. They show up in new <TR><TD> etc, but the empty <TR><TD>'s are still there.

Condor
24 Nov 2010, 1:54 AM
TableLayout doesn't support removing items.

Maybe you should consider using a different layout (hbox/vbox or column)?

plalx
24 Nov 2010, 5:32 AM
@Condor, Is there any reason they decided not to support items removal?

Condor
24 Nov 2010, 9:07 AM
It was too complex to put in such a simple layout.

Think about what should happen when you remove a single item - should every first items in following rows be moved up one <tr>? And this gets even more complex when you are using column and row spanning.