Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by pyt on Nov 12, 2008 05:10
open dhtmlx forum
dhtmlxWindow und grid

Hi,
i use dhtmlxgrid v.1.6. I have created a contextmenu in grid. Now i want to display a dhtmlxWindow, by clicking the item in context menu. I use the following codes in js:

function onButtonClick(itemId,itemValue){

    if(itemId == "addNotes"){
     dhxWins= new dhtmlxWindows();
dhxWins.setImagePath("../images/imgs/windows_imgs/");
dhxWins.createWindow("add",200,200,50,40);

}
}
But it doesn't work.
Can you help me?

Thanks in advance!
pyt
Answer posted by Support on Nov 12, 2008 05:37
What kind of error?
Could you please provide more code?
Answer posted on Nov 12, 2008 05:57
<script>
  function doInitGrid(){
 
   mygrid = new dhtmlXGridObject('mygrid_container');
   mygrid.setImagePath("../images/imgs/");
  dhxWins= new dhtmlxWindows();
  dhxWins.setImagePath("../images/imgs/windows_imgs/");
   aMenu=new dhtmlXContextMenuObject('120',0,"../images/menu_imgs/");
   aMenu.menu.loadXML("../codebase/_context2.xml");
   aMenu.setContextMenuHandler(onButtonClick);
   mygrid.enableContextMenu(aMenu);
   ...
   mygrid.loadXML(...);
   ...
  }
function onButtonClick(itemId,itemValue){ 
      if(itemId == "addNotes"){  
        dhxWins.createWindow("add",200,200,50,40);
    }  
  }
...
</script>
<div id="mygrid_container" style="width:900px;height:400px;background-color:white;overflow:hidden"></div>

The error is: dhtmlxWindows is not defined.


Answer posted by Support on Nov 12, 2008 07:32
try this:

dhxWins= new dhtmlXWindows();