How to set my window which does not move out side of layout

Hi
Actually i try to create a window and my requirement is my window does not drag out side of the layout cell.

  1. the window must be attached into dhtml layout cell
  2. It does not allow drag out side of the layout cell
    so please help me with some examples

Hi,

you may set layout cell as window viewport:

dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo(layout.cells(“a”));
dhxWins.setSkin(“dhx_skyblue”);
dhxWins.setImagePath("…/…/codebase/imgs/");

and enable keepInViewport for it:

win = dhxWins.createWindow(…);
win .keepInViewport(true);

I need the same thing but the code above no longer works. I removed the “enableAutoViewport” line since that was deprecated but it still will not work. Here is my code…

dhxWins = new dhtmlXWindows(); //dhxWins.enableAutoViewport(false); dhxWins.attachViewportTo(c3.layout.cells("a")); w1 = dhxWins.createWindow("w1", 20, 30, 320, 200); w1.keepInViewport(true);
Console error is: Uncaught TypeError: undefined is not a function. It points to dhtmlx.js line 9 column 1275861, which is this… this.vp.appendChild(K);

Is this a bug or am I doing something wrong?

Hi

try to replace c3.layout.cells(“a”) with c3.layout.cells(“a”).cell, but I recomment to use ‘middle’ object, here is a demo:
dhtmlx.com/docs/products/dhtmlxL … _cell.html