Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dactar on Oct 22, 2008 10:21
open dhtmlx forum
Attach dhtmlxWindow in a cell of dhtmlxLayout

Hello :)

Is it possible to attach one or several dhtmlxWindow(s) in a big cell of a layout ?

Example : I've a 3T layout and I want to attach 3 different dhtmlxwindows in the cell 'c'.

Thanks :)
Answer posted by Support on Oct 23, 2008 01:53
Hello

Do you mean using cell "c" as a windows' viewport?
Answer posted by dactar on Oct 23, 2008 02:06
yes
Answer posted by Support on Oct 23, 2008 02:45
Try this:

<body onload="doOnLoad();">

    <!-- layout's container -->
    <div id="parentId" style="position: relative; top: 20px; left: 20px; width: 1000px; height: 780px;"></div>

    <!-- will used as windows viewport -->
    <div id="winVP" style="position: relative; width: 100%; height: 100%; overflow: hidden; diaply: none;"></div>

</body>


    <script>

        function doOnLoad() {
            // initing layout
            var dhxLayout = new dhtmlXLayoutObject("parentId", "3L");
            // attaching object (will used as windows viewport)
            dhxLayout.cells("c").attachObject("winVP");
            // creating windows system
            var dhxWins = new dhtmlXWindows();
            // turning off the default viewport rendering
            dhxWins.enableAutoViewport(false);
            // rendering a viewport as an existing object on page
            dhxWins.attachViewportTo("winVP");
            // creating windows
            dhxWins.createWindow("w1", 10, 10, 300, 190);
            dhxWins.createWindow("w2", 20, 20, 300, 190);
            dhxWins.createWindow("w3", 30, 30, 300, 190);
        }

    </script>

Fix dhtmlxwindows.js (for correct maximizing):

this._maximizeWindow = function(win) {
    .....
    2 full lines below
    win.w = (win.maxW == "auto" ? (this.vp == document.body ? ....
    win.h = (win.maxH == "auto" ? (this.vp == document.body ? ....
    replace with
    win.w = (win.maxW == "auto" ? (this.vp == document.body ? "100%" : (this.vp.style.width != "" && String(this.vp.style.width).search("%") == -1 ? parseInt(this.vp.style.width) : this.vp.offsetWidth)) : win.maxW);
    win.h = (win.maxH == "auto" ? (this.vp == document.body ? "100%" : (this.vp.style.height != "" && String(this.vp.style.width).search("%") == -1 ? parseInt(this.vp.style.height) : this.vp.offsetHeight)) : win.maxH);
Answer posted by dactar on Oct 24, 2008 02:01

Hello, it works great thanks :)

but...when I attach grid objects to the three windows, the layout height decrease, I don't know why.

I'm using a 3T layout initialised in fullscreen mode.

If you need I can build an example and attach it to this ticket during the week-end.

Another question : I've modified dhtmlxwindows.js for correct maximizing. Is this correction will take part of the next version of dhtmlxwindow ?

Thanks for your answers

Answer posted by Support on Oct 24, 2008 04:11
Hi,

>> If you need I can build an example and attach it to this ticket during the week-end.
yes, please make a sample

>> Is this correction will take part of the next version of dhtmlxwindow ?
yes, correction will take part in future release.
Answer posted by dactar on Dec 08, 2008 08:35
Here's the sample

:)
Attachments (1)
test.html5.48 Kb
Answer posted by Support on Dec 08, 2008 09:31
Add the following style:

html,body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    margin: 0px;
}
Answer posted by dactar on Dec 08, 2008 14:43
I've tried but there's no effect on this sample.
Answer posted by Support on Dec 09, 2008 00:20
Could you please attach a screenshot with the issue, because its ok on our side?
Answer posted by dactar on Dec 09, 2008 08:57
Hello :)

Here's the screenshot.

Browser used : Firefox 3.0.4
OS : GNU / Linux : Ubuntu 8.10
Attachments (1)
test.png91.00 Kb
Answer posted by Support on Dec 15, 2008 04:07
Its all ok on our side. Here is a screenshot.

(Ubuntu 7.10 / Firefox 3.0.3)
Attachments (1)
Answer posted by dactar on Dec 18, 2008 03:42

Hello I didn't find the reason, so can you attach your test case with all dependancies ?

Thanks :)

Answer posted by Support on Dec 19, 2008 04:11
Hello, take it.
Attachments (1)
demo.zip130.91 Kb