Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by aspi on Jul 22, 2008 07:58
open dhtmlx forum
dhtmlXWindow

Hi Again!

Thank your previous help.

firefox 3 version not working but working in IE6 fine.

the code:

var dhxWins = new dhtmlXWindows();
    
            dhxWins.createWindow("w1",0, 0, 800, 600);
            dhxWins.enableAutoViewport(false);
            dhxWins.vp.style.border = "#909090 1px solid";
            dhxWins.setViewport(0, 0, 1024, 1024);
            dhxWins.setImagePath("js/window/imgs/");
            dhxWins.window("w1").setText('Nyomtatási nézet');
            
            // extended features
            
            dhxWins.window("w1").clearIcon(); // hide icon
            dhxWins.window("w1").denyResize(); // deny resizing
            dhxWins.window("w1").button("park").hide();
            //win.button("resize").hide();
            dhxWins.window("w1").button("close").enable(); // disable "close" button
            dhxWins.window("w1").center();
            dhxWins.window("w1").attachURL("http://localhost/april/april_0_0_2/nyomtatas.php");
            dhxWins.window("w1").setModal(true);
the print.php => fpdf generated pdf



this working but i can't drag the window in firefox3

dhxWins.createWindow("w1", 200, 200, 800, 600);
            dhxWins.enableAutoViewport(false);
            dhxWins.vp.style.border = "#909090 1px solid";
            //dhxWins.setViewport(0, 0, 1024, 1024);
            dhxWins.setImagePath("js/window/imgs/");
            dhxWins.window("w1").setText('Nyomtatási nézet');
            
            // extended features
            
            dhxWins.window("w1").clearIcon(); // hide icon
            dhxWins.window("w1").denyResize(); // deny resizing
            dhxWins.window("w1").button("park").hide();
            //win.button("resize").hide();
            dhxWins.window("w1").button("close").enable(); // disable "close" button
            //dhxWins.window("w1").center();
            dhxWins.window("w1").attachURL("http://localhost/april/april_0_0_2/nyomtatas.php");
            dhxWins.window("w1").setModal(true);

thank you
Answer posted by Support on Jul 23, 2008 08:08
Hello

You have some errors in your code:

1. two different windows have the similar id ("w1" in your case, it it incorrect, ids should be unique)
2. just one window can be modal at time (you have two in your code)
3. it is not necessary to call viewport relative method several time, single call will be enough (just note)

Try the following code:

<script>

    var dhxWins = new dhtmlXWindows();

    dhxWins.enableAutoViewport(false);
    dhxWins.vp.style.border = "#909090 1px solid";
    dhxWins.setViewport(0, 0, 1024, 1024);
    dhxWins.setImagePath("js/window/imgs/");

    var w1 = dhxWins.createWindow("w1", 0, 0, 400, 300);
    w1.setText("window #1");
    w1.clearIcon();
    w1.denyResize();
    w1.button("park").hide();
    w1.button("close").enable();
    w1.center();
   
    var w2 = dhxWins.createWindow("w2", 200, 200, 400, 300);
    w2.setText('window #2');
    w2.clearIcon();
    w2.denyResize();
    w2.button("park").hide();
    w2.button("close").enable();

</script>

If you'd like to make one of windows modal, you shold use the following methods (in the code above after 'w2.button("close").enable();'):

    w1.setModal(true); // for 1st window
    // or
    w2.setModal(true); // for 2nd window

If any errors still occures please write the matters of windows usage for you and we will write a small demo.