Check documentation for the latest version of dhtmlxSuite getActiveItem DHTMLX Docs

getActiveItem

returns id of the active item

string|number getActiveItem();
string|numberthe items's id or null if the item is not selected

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", selected: true},
        {id: "a2", text: "Item 2", icon: "image2.png"}
    ]
});
 
// get the active item
var actvId = mySidebar.getActiveItem();

Back to top