Hello
I wanted to place a PopUp into a Grid Cell when clicking into this cell. I never before worked with PopUp function and don’t understand why my code desn’t work. Maybe there is a problem because PopUp is a component of the Suite ?
Here i made a little test file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link href="../dhtmlx/Popup/skins/dhtmlxpopup_dhx_skyblue.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Grid/codebase/skins/dhtmlxgrid_dhx_blue.css" rel="stylesheet" type="text/css">
<script src="../dhtmlx/Popup/dhtmlxpopup.js"></script>
<script src="../dhtmlx/Grid/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Grid/codebase/dhtmlxgrid.js"></script>
<script src="../dhtmlx/Grid/codebase/dhtmlxgridcell.js"></script>
</head>
<body>
<div id="gridbox" style="height:63px;width:180px"></div>
<script type="text/javascript">
// GRID
// ----
var myGrid = new dhtmlXGridObject('gridbox');
myGrid.setImagePath("../dhtmlx/Grid/codebase/imgs/");
myGrid.setHeader("A,B,C");
myGrid.setInitWidths("60,60,60");
myGrid.setColAlign("center,center,center");
myGrid.setColTypes("ro,ro,ro");
myGrid.setColSorting("str,str,str");
myGrid.enableTooltips("false,false,false");
myGrid.attachEvent("onRowCreated", function(id,rObj,rXml){
myGrid.setCellTextStyle(id,0,"color:#900;font-weight:bold;cursor:pointer");
});
myGrid.attachEvent("onRowSelect", function(id,ind){
switch (ind) {
case 0: myPopUp.show(20,20,200,300); break;
}
});
myGrid.setSkin("dhx_blue");
myGrid.init();
myGrid.addRow('1',['Test A','Test B','Test C']);
myGrid.addRow('2',['Test D','Test E','Test F']);
myGrid.addRow('3',['Test G','Test H','Test I']);
// POPUP
// -----
var myPopUp = new dhtmlXPopup();
myPopUp.attachHTML("This is a Test");
</script>
</body>
</html>
Would be really great if anybody could help me with this.
Thank you