Check documentation for the latest version 6.0 of dhtmlxSuite enableDynamicLoading DHTMLX Docs

enableDynamicLoading

enables dynamic loading of sublevels

void enableDynamicLoading(string url,boolean icon);

Parameters

urlstringserver-side script
iconbooleantrue/false, replaces element's arrow with loading image while loading

Example

myMenu.enableDynamicLoading("server.php", true);

Details

Menu sends two params to server-side script (in POST data):

  • action=loadMenu
  • parentId=ID, where ID is parent item id, for sublevels only

XML Format

// top-level
<menu>
    <item id="navigation" text="Navigation" complex="true"></item>
    <item id="help" text="Help" complex="true"></item>
</menu>
 
// sublevel (for navigation)
<menu parentId="navigation">
    <item id="nav_general" text="General" complex="true"></item>
    <item id="nav_settings" text="Settings" complex="true"></item>
</menu>
 
// sublevel (for help)
<menu parentId="help">
    <item id="help_about" text="About..." img="about.gif"></item>
    <item id="help_help" text="Help" img="help.gif"></item>
    <item id="help_bugrep" text="Bug Reporting" img="bugrep.gif"></item>
</menu>

JSON Format

// top-level
[
    {id: "navigation", text: "Navigation", complex: true},
    {id: "help", text: "Help", complex: true}
]
 
// sublevel (for navigation)
{
    parentId: "navigation",
    items: [
        {id: "nav_general", text: "General", complex: true},
        {id: "nav_settings", text: "Settings", complex: true}
    ]
}
 
// sublevel (for help)
{
    parentId: "help",
    items: [
        {id: "help_about", text: "About...", img: "about.gif"},
        {id: "help_help", text: "Help", img: "help.gif"},
        {id: "help_bugrep", text: "Bug Reporting", img: "bugrep.gif"}
    ]
}
Back to top