Duplicate Control

The following setup seems to draw my control twice. The first time with the original setup and then the second time with the new setup. One under the other. Reading the doc seems to imply I should see a replacement.

    var sizingScenarios =   {cols: [toolbar, scenarioListWithHeader, {view: "resizer"}, dataGridBody]};
    var systemContexts =   {cols: [toolbar, systemContextWithHeader, {view: "resizer"}, dataGridBody]};

    var theWholeScreen = ({
        container: "webixUItable",
        id: "theWholeThing",
        type: "wide"
    });

    theWholeScreen.rows = [ sizingScenarios ];
    webix.ui(theWholeScreen);

    theWholeScreen.rows = [ systemContexts ];
    webix.ui(theWholeScreen, $$("theWholeThing"));

What am I not understanding?

thanks,
dk-

You don’t have to redefine the view with the same container:

http://webix.com/snippet/0ba5f06a

On the other hand, the best practice to redefine similar elements is to set the array of items as the new config:

http://webix.com/snippet/a713a79d

Hi Listopad,

What is the thinking behind the “best practice” method. How does it work. It seems odd to me that you can just add an arbitrary structure, and somehow the webix.ui() method knows that I’m really trying to redefine the rows attribute.

If you have some view that can contain child views (I mean layout, toolbar, form or multiview), you can use the mentioned way to replace the child views with the array that has the same structure: rows to rows, cols to cols, etc.