Franky
March 18, 2013, 6:33pm
#1
Hi
I try to attach a Grid and a Tabbar to a (popup)Window.
But that didn’t work the way I do that
Code I use is like that:
…
…
dhxWinsParams = {
image_path: “codebase/imgs/”,
wins: [{
id: “w3”,
left: 250,
top: 100,
width: 1060,
height: 755
}]
};
dhxWins = new dhtmlXWindows(dhxWinsParams);
dhxWins.window(“w3”).setText(“text text text”);
tabbar = new dhtmlXTabBar(“a_tabbar”, “top”);
tabbar.setSkin(‘dhx_skyblue’);
tabbar.setImagePath(“codebase/imgs/”);
tabbar.addTab(“a1”, “Tab 1-1”, “100px”);
tabbar.addTab(“a2”, “Tab 1-2”, “100px”);
tabbar.setTabActive(“a1”);
tabbar = dhxWins.window(“w3”).attachTabbar();
var grid = tabbar.cells(“a1”).attachGrid();
grid.setImagePath(“codebase/dhtmlxGrid/codebase/imgs/”);
grid.loadXML(“data/grid_1.xml”);
Any help or may examples would be very helpfull !!!
Thanks a lot !
Kind regards,
Frank
Franky
March 18, 2013, 10:00pm
#2
Hi
I found a working solution:
dhxWinsParams = {
image_path: "codebase/imgs/",
wins: [{
id: "w1",
left: 150,
top: 50,
width: 1650,
height: 900
}]
};
dhxWins = new dhtmlXWindows(dhxWinsParams);
dhxWins.window("w1").setText("text text text");
dhxWins.window("w1").denyResize();
dhxWins.window("w1").centerOnScreen();
win_layout = dhxWins.window("w1").attachLayout("1C");
tabbar = win_layout.cells("a").attachTabbar();
tabbar.setImagePath("codebase/imgs/");
tabbar.addTab("a1", "Tab one", "100px");
tabbar.addTab("a2", "Tab two", "100px");
tabbar.setTabActive("a1");
var grid = tabbar.cells("a1").attachGrid();
grid.setImagePath("codebase/dhtmlxGrid/codebase/imgs/");
grid.loadXML("grid1.xml");
var grid = tabbar.cells("a2").attachGrid();
grid.setImagePath("codebase/dhtmlxGrid/codebase/imgs/");
grid.loadXML("grid2.xml");
Could anybody please confirm that this is the right way ?
Thankd a lot !
Frank
Darya
March 19, 2013, 8:28am
#3
Hi
It is right way, but pay attention, what closing this window destroys its content.
Recommend you to hide() this window at init and show() it when it pops up. Then hide() this window via onClose event.