DHTMLX Docs & Samples Explorer

forEachItem(handler)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxmenu.js

iterator, calls a user handler for each item

  • handler - a user function, will take the item id as an argument
menu.forEachItem(function(itemId){
    // code here
});
// or
function doWithItem(itemId){
    // code here
}
menu.forEachItem(doWithItem);