Check documentation for the latest version of dhtmlxSuite hide DHTMLX Docs

hide

hides the specified item

void hide( [string|boolean actvId] );
actvIdstring|boolean(optional) if the specified item is selected, selects another item, true by default

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"},
        {id: "a3", text: "Item 3", icon: "image3.png"}
    ]
});
 
mySidebar.items("a1").hide(); // hide a1 and select a2
// or
mySidebar.items("a1").hide("a3"); // hide a1 and select a3
// or
mySidebar.items("a1").hide(false); // hide a1 and do not select any item

Details

if actvId is set to true - tries to select the nearest item, false - selects nothing. You can also specify id of the item to be selected.

Back to top