View Full Version : TableLayout and removeAll() / use HBOX instead

17 Jul 2010, 9:03 PM
So it turns out, if you use removeAll() on a Container that uses a TableLayout, it does not remove the components' TRs and it causes layout problems.

Is there a workaround/override for this or something?

If there's no fix, I am thinking of using HboxLayout instead. The only problem is I don't know how to imitate the TableLayout. I want to limit the no. of columns, then automatically wraps the components as rows.

Any ideas?

17 Jul 2010, 9:39 PM
Ok, so I tried manually clearning the tbody but still no luck.

17 Jul 2010, 10:41 PM
Do you want to destroy (and therefore never use again) the child items in the table layout Container?

17 Jul 2010, 11:54 PM
Thanks for the reply Animal. Here's what I'm trying to do:

1. On panel activation / rendering, an AJAX request will fire and retrieve a list of data.
2. The list will then be used to create a number of Ext.Button inside the panel.
3. Now when the panel becomes inactive, hidden, etc. then activated again, the data will be reloaded, and so as the buttons. That's why I'm using removeAll() on the panel.

18 Jul 2010, 12:02 AM
Answer the question

18 Jul 2010, 5:57 AM
You could try ColumnLayout or Animal's FloatLayout (see the user extensions forum) instead of TableLayout.

18 Jul 2010, 6:16 AM
If they are not needed again, destroy all items, and remove the <table>, delete the layout's table reference, and it will begin all over again.