Change layout pattern

Is it possible to change the layout pattern dynamically? As in:

open layout using 3E.
User decides he doesn’t like it.
Picks 4U.
Just that 3E layout closes and re-opens as 4U.

I don’t want to have to close/refresh the entire hta and reopen it.

You need reinitialize a layout to use the new pattern:

dhtmlxLayout/samples/02_conf/01_patterns.html

I did see the .unload() function and tried it. I get an error on line 2505 of layout.js “Object doesn’t support this property or method”.

this.detachAllEvents();
This is the error line.

I have a main layout (2U) with a menu and tabbar attached. In the first tab I have another tabbar attached. In the first tab I have the layout (3L) I want to be able to swap.

In the 3L cells, A has a tree, B has a grid, C is empty. I have a toolbar attached, also. The layout closes, the toolbar stays (which is fine), then I get the error, nothing else has been done yet.

Do I have to do something with the tree and/or grid first?

We need the complete demo to recreate the problem.

I think the Tabbar is what is causing the issue.

In the above example, when I open a new tab in the second tabbar without a toolbar, all is good. But when I .attachToolbar() then close it, I get an error. Both the X (close button) and RemoveTab() cause an error.

To try and prove this, in the first tab that is always open, I did not attach the toolbar, but left the layout, tree, and grid. Tried to switch patterns, error.

It seems the Tabbar’s tab is not releasing the items attached to it.

I will try to get a demo worked up. My program is too far along to rip things out.

Both the X (close button) and RemoveTab() cause an error.

There was a bug in the removeTab() method. Make sure that you use the latest tabbar version.

Regaring other problems - we need a complete demo for testing

I am using the v2.6 from the download package. If the individual tabbar zip is newer then I will get that one.

I emailed a demo to support@dhtmlx.com yesterday. I have not heard back from them yet.

I don’t suppose anybody is still following this discussion but did anybody solve this? As per the original discussion I am trying to dynamically allow the user to change the layout of the page whilst maintaining the same data in it.

Thanks

Layout supports views. Possibly this feature will solve the problem:

docs.dhtmlx.com/doku.php?id=dhtm … yout_views

I did find a fix for it: I didn’t do what the instructions say.

I was doing: MailLayout.unload();

I commented out that line and just remade the new layout and it works fine. I may be losing some memory, but not much.

thanks guys

Hi there,
so i have to unload and reinit the layout with the new pattern to change it?

mediamemphis
Hi,
yes, you are right!
It is in most cases.

But sometimes you can use the following:
docs.dhtmlx.com/doku.php?id=dhtm … yout_views
dhtmlx.com/docs/products/dht … views.html

1 Like