Scrollbar in dhtmlXWindows

Hi,

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();
});

Hello,

scroll should be enabled for “dhxwin_edit” container that is attached to the window:

Hi Alexandra,

Thanks for the response.

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

line with yours but it is still the same.

Thanks,
Dhanan.

There was a typo in my previous reply overflow:auto

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?

Thanks,
Dhanan.

Dhanan,

you may find such a sample in the window package:

dhtmlxWindows/samples/01_init/07_attach_object.html

Hi ,

I’m trying to programmatically add content to a dhtmlXLayout area, from JavaScript like this:

var html = "

....
";

myLayout.cells(‘c’).attachHTMLString(html);

The html renders fine, but the scrollbars do not appear. Is there a way to do this from JavaScript?

Thanks!

Grant

Hi,

try the following content:

var html = "

";

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();

and here is the html script

<div id="myWindow" style="height: 250px; overflow: auto;"></div>
<div id="myGrid"></div>

any kind of help is appreciated. Thanks in advance :slight_smile:

Never mind about my last post…I just learn that it is a wrong way to attach a grid. I should have used win.attachGrid() instead :slight_smile:

Same problem with me… :frowning:

<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, :smiley:
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.

It’s default setting or wrong in my code ? :unamused:

Here is your approach:

function doOnLoad() { main_layout = new dhtmlXLayoutObject(document.body, '2E'); top1 = main_layout.cells('a'); dhxMenu = top1.attachMenu(); top1.attachObject("winVP"); dhxMenu.setIconsPath("dhtmlxMenu/common/imgs/"); dhxMenu.loadXML("dhtmlxMenu/common/dhxmenu.xml"); dhxWins = new dhtmlXWindows(); dhxWins.enableAutoViewport(false); dhxWins.attachViewportTo("winVP"); dhxWins.setImagePath("dhtmlxWindows/codebase/imgs/"); dhxWins.createWindow("w1", 10, 10, 300, 300); w1 = dhxWins.window("w1"); w1.maximize(); w1.attachURL("content_.html"); }
Body: