Load two components in dhtmlxWindow

I’m trying to load a TreeGrid and a Form in the same window.
However, I can only get it to load one of the controls (the one created last in my code).
My code is something like this:

dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo(“winVP”);
myWindow = dhxWins.createWindow(id, 20, 30, 450, 300);

myTreeGrid = myWindow.attachGrid();

myTreeGrid.init();
myTreeGrid.load(“test.json”, “json”);

var formStructure = [
{type: “button”, name: “btn”, value: “Cancel”},
{type: “button”, name: “btn”, value: “Add file”}
];
myForm = myWindow.attachForm(formStructure);

How do I load these two components in the same window?
Thanks

The best practice is to place the layout in your window and attach each required component to the unique layout cell.
In case of using the attach"dhxComponent"() method that component occupies the whole cell of the container and all other attaching components/panels replace that component.