Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Larry on Dec 03, 2008 11:02
open dhtmlx forum
Layout Cell Layering

OK.  Tried the following:  

  var dhxWins = new dhtmlXWindows();
  dhxWins.attachViewportTo("vp_container");
  dhxWins.vp.style.border = "#909090 1px solid";
  dhxWins.setImagePath("../../codebase/imgs/");
  var w1 = dhxWins.createWindow("w1", 380, 10, 320, 240);
  w1.setText("dhtmlxWindow");
  w1.button("close").disable();
  w1.attachObject('obj');

  var dhxWins2 = new dhtmlXWindows();
  dhxWins2.attachViewportTo("new_container");
  dhxWins2.vp.style.border = "#909090 1px solid";
  dhxWins2.setImagePath("../../codebase/imgs/");

  var dhxLayout = new dhtmlXLayoutObject(document.body, "3L");
  dhxLayout.cells("a").attachObject("btnObj");
  dhxLayout.cells("c").attachObject("dhxWins");
  dhxLayout.cells("c").attachObject("dhxWins2");

The Windows did not attach properly to Layout Cell "C" nor does there seem to be a way to make them layer nor come to the top.  I would further like them to completely fill Layout Cell "C".  Just like in the Tabbar or Accordian.

One other thing I dabbled with just creating and then later attaching the object from an HTML Button Layout Cell "A" without any special window objects like so:

  <input type="button" onclick="dhxLayout.cells('c').attachObject('objId4');" name="btn8" value="Display Window 4"><br>

which worked fine except if you have to use the object ('objId4') again.  Strangely though any standalone URL will work over and over.

Answer posted by Support on Dec 04, 2008 02:19
<body>
    <!-- will used as viewport -->
    <div id="winVP" style="display: none; position: relative; width: 100%; height: 100%; overflow: hidden;"></div>
    ...
<script>
    var dhxLayout = new dhtmlXLayoutObject("parentId", "3L");
    // attach viewport to cell
    dhxLayout.cells("a").attachObject("winVP");
    // init windows
    var dhxWins = new dhtmlXWindows();
    // set user-defined viewport
    dhxWins.enableAutoViewport(false);
    dhxWins.attachViewportTo("winVP");
    // create window
    var w1 = dhxWins.createWindow("w1", 10, 10, 320, 200);
    ...