window define()

hi,

im trying to change window content on the fly, so i tried something like this:

$$("mywin").define("head", { view:"toolbar", type:"MainBar", data:[ { type:"label", label:"Adressen 2" } ] });

in the example im trying to change the “head” parameter from “Adressen” to “Adressen 2” but instead of that i get the old “head” and the new “head” together see screenshot.

Same happens when trying to change the “body” parameter.

Am i doing something wrong?

Btw, i know that i can change the “label” directly but thats not what im trying to do, i need to change all the window content on the fly.

Thank you.

Jorge Figueroa
Crossdata-tools

Due to some problems in current version, it is not possible to fully replace header, but you can use

$$("mywintoolbar").clearAll(); $$("mywintoolbar").parse([ { type:"label", label:"Adressen 2" } ]);

Where mywintoolbar - id of toolbar in header.
Above code will reload toolbar with different set of labels|buttons.

thank you Stanislav but i need to replace the body content too, currently i have a dataview on the first row of the window “body” like this:

body:{ type:"clean", rows:[ { view:"dataview", id:"addressdataview", width:790, height:350, align: "center", ..... ....

and when i press a button i need to replace this dataview with another component i.e. a template, will this be possible in next release with the $$(“mywin”).define(“body”, …)?

Yep, it will be possible.
Technically it must be possible in the current version as well, but there is a bug in component.destructor() which doesn’t allow to fully remove old content.
Issue will be fixed in oncoming update.

Hi,

I want to change the body of a window on the fly too…but no luck!!!

I am using the 3.0 version from 1209123…

is the bug fixed?

Thanks in advane…

greetings!

Hello,

Please check the following sample. It shows how to change views dynamically:

dhtmlxTouch_v12_120913/samples/09_template/03_ajax_ui.html

You can change layout collection dynamically and replace layout row/column with another one. This approach works only for layouts.

Perfect!! Thanks Alexandra!!