I have created a window using dhtmlXWindows as shown in the code snippet. The items I’ll be displaying in this window is dynamic. So if the items exceed the viewable area, I want a scrollbar to appear automatically. Can you tell me how I can do it?
Thanks in advance,
Dhanan.
var myLayout = new dhtmlXLayoutObject(document.body, "2U", "dhx_skyblue");
...
...
var dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo("dhxwin_edit");
editWin = myLayout.dhxWins.createWindow("editWin", 187, 3, 818, 598);
editWin.denyResize();
editWin.setModal(true);
editWin.denyMove();
editWin.setText("View/Edit Group Properties");
editWin.attachObject("dhxwin_edit", true);
editWin.attachEvent("onClose", function() {
editWin.detachObject("dhxwin_edit");
editWin.setModal(false);
editWin.hide();
});
I added ‘overflow:auto’ in my code as follows, and I reduced height to force the scrollbar to appear, but I still don’t see the scrollbar. Instead, the extra elements in the window are getting hidden. Am I missing anything else? I even tried replacing my
Even with the typo corrected, I still don’t see the scrollbar appearing when the controls overflow the window size. Do you have any sample code for window with auto scrollbar?
hai, I’m trying to attach a dhtmlxgrid into the window and I can’t find a way to make the scroll bar appears. I have already used the “overflow: auto”. Am I missing something?
var dhxWins = new dhtmlXWindows();
var win = dhxWins.createWindow("myWindow", 100, 100, 600, 400);
win.setText("Hello World");
win.attachObject("myGrid");
var mygrid = new dhtmlXGridObject("myGrid");
mygrid.setHeader("Model,Qty,Price");
mygrid.setInitWidths("*,150,150");
mygrid.setColAlign("left,right,right");
mygrid.setSkin("light");
mygrid.init();
<div id="winVP" style="width:100%; height:50%; background-color:#FFFFFF; oveflow:auto" ></div>
var main_layout = new dhtmlXLayoutObject(document.body, '2E');
var top = main_layout.cells('a');
top.attachObject("winVP");
var dhxMenu = top.attachMenu();
dhxMenu.setIconsPath("dhtmlx/menu/imgs/");
dhxMenu.enableDynamicLoading("dhtmlx/menu/dhtmlxmenu_dl.php");
var dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo("winVP");
dhxWins.setImagePath("dhtmlx/codebase/imgs/");
I attach layout to body, and then attach menu to layout and attach windows to layout cell.
What’s the problem ?
The menu & windows is appear in winVP but, not scrollable when windows hight is out of size.
First of all: you can’t use a name ‘top’ for appropriation of layout cell A, it is a reserved JS word.
See attached demo - i show you there how to use all your components (withod server-side scripts). demo.rar (329 KB)
Thanks Darya,
I’ve been download the attachment and see it.
But, in my Question is about
There no scroll when the windows height is out of range of div.
this is the problem :
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo(“winVP”);
I create new one, without Layout, and testing again… but problem is still same.
I try to change div “winVP”, set overflow to “scroll”, when windows load into div the scroll disappear.