goToNextItem

selects the item next to the active one or the first one, if nothing is selected

void goToNextItem(boolean callEvent);

Parameters

callEventbooleanset to 'true' to call onBeforeSelect/onSelect events

Example

// init sidebar
var mySidebar = new dhtmlXSideBar({
    parent: "sidebarObj",
    template: "details",
    icons_path: "icons/16x16/",
    width: 160,
    items: [
        {id: "a1", text: "Item 1", icon: "image1.png"},
        {id: "a2", text: "Item 2", icon: "image2.png"}
    ]
});
 
// onSelect event callback
mySidebar.attachEvent("onSelect", function(id){
    // init cell or other action
});
 
// select 1st item and call event
mySidebar.goToNextItem(true);

Back to top