Help! How to attach toolbar on window


#1

How to attach toolbar on a window instance?

var winx = new dhx.Window({
 title: 'Test',
 modal: true,
 width: 800,
 height: 420
});

var toolbar = new dhx.Toolbar(null);
toolbar.data.parse([
     {
        type: "button",
        icon: "dxi-plus",
        value: "new"
    },
    {
        type: "button",
        icon: "dxi-folder-open",
        value: "close"
    },
]);

winx.attach(toolbar);

/// NOT WORKING
How to proper attach toolbar in window like in V5?

June 2, 2020 6:48 AM (Europe: Paris), June 1, 2020 9:48 PM (America: Los Angeles)


#2

Your code works correctly, see snippet:
https://snippet.dhtmlx.com/xshy2plm

Note that Window header and footer are already toolbars, you may add buttons to them. See example:
https://docs.dhtmlx.com/suite/samples/window/04_customization/03_custom_buttons.html

and doc article:
https://docs.dhtmlx.com/suite/window__customization.html#controlsandoperations