Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jame Chiang on Jul 25, 2009 00:05
open dhtmlx forum
dhtmlxMenu - same file but Got error message under Visual Studio 2005

I am using dhtmlxMenu v.2.0 Standard edition build 81009/81107

<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="../dhtmlxSuite/dhtmlxMenu/codebase/skins/dhtmlxmenu_glassy_blue.css">
<link rel='STYLESHEET' type='text/css' href='../dhtmlxSuite/dhtmlxMenu/codebase/style.css'>
<script src="../dhtmlxSuite/dhtmlxMenu/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlxSuite/dhtmlxMenu/codebase/dhtmlxmenu.js"></script>
<script>
    var menu;
    function initMenu() {
        menu = new dhtmlXMenuObject("menuObj","glassy_blue");
        menu.setImagePath("../dhtmlxSuite/dhtmlxMenu/codebase/imgs/");
        menu.setIconsPath("../dhtmlxSuite/dhtmlxMenu/codebase/images/");
        menu.loadXML("../xml/dhtmlxmenu.xml?etc="+new Date().getTime());
        menu.setItemDisabled("m11");
    }
</script>

</head>
<body onload="initMenu();">
<div id="menuObj" style="position: absolute; top: 0; right: 0; width: 260px;">
</div>
</body>


This html file work fine under not Visual Studio 2005 environment
If under that environment, when execute to “menu.setItemDisabled("m11");”
Visual Studio show error message
'this.itemPull[...].patent' is null or not an object

dhtmlxmenu.js : stop at line 23
return (this.itemPull[thi's.idPrefix+id]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")
Answer posted by Alex (support) on Jul 27, 2009 01:48

Hello, 

the operations with items should be executed after the xml (items) is loaded:

menu.loadXML("../xml/dhtmlxmenu.xml?etc="+new Date().getTime(),function(){

  menu.setItemDisabled("m11");

});

Answer posted by Frank Lin on Jul 27, 2009 03:37

My program is no difference with your answer.

This html file work fine under not Visual Studio 2005 environment
If under that environment (Visual Studio 2005 environment ), when execute to “menu.setItemDisabled("m11");”
Visual Studio show error message
'this.itemPull[...].patent' is null or not an object

dhtmlxmenu.js : stop at line 23
return (this.itemPull[thi's.idPrefix+id]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")

 

 

Answer posted by Alex (support) on Jul 27, 2009 05:24

The issue was not reproduced locally. Please, provide the complete sample or direct link to the problematic page.

Answer posted by Frank Lin on Jul 27, 2009 06:36

<!--conf
<sample>
              <product version="1.0" edition="std"/>
                     <modifications>
                            <modified date="080318"/>
                     </modifications>
               </sample>
 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
 <title>Menu Items State Manipulation</title>
    <link rel="stylesheet" type="text/css" href="../dhtmlxSuite/dhtmlxMenu/codebase/skins/dhtmlxmenu_dhx_blue.css">

    <script src="../dhtmlxSuite/dhtmlxMenu/codebase/dhtmlxcommon.js"></script>
    <script src="../dhtmlxSuite/dhtmlxMenu/codebase/dhtmlxmenu.js"></script>
    <link rel='STYLESHEET' type='text/css' href='../dhtmlxSuite/dhtmlxMenu/codebase/style.css'>   
</head>
<body onload="initMenu();">

    <div id="menuObj" style="position: absolute; top: 0; right: 0; width: 260px;"></div>
<br>

<script>
 var menu;
 function initMenu() {
  menu = new dhtmlXMenuObject("menuObj");
  menu.setImagePath("../dhtmlxSuite/dhtmlxMenu/codebase/imgs/");
  menu.setIconsPath("../dhtmlxSuite/dhtmlxMenu/codebase/images/");
  menu.loadXML("../xml/dhtmlxmenu.xml?etc="+new Date().getTime());


  menu.setItemDisabled("m11");
 }

</script>

</body>
</html>

Answer posted by Alex (support) on Jul 27, 2009 07:24

Please, try the attached sample. Here menu.setItemDisabled("m11"); is called in the way that has been recommended in the previous reply.

Attachments (1)