Check documentation for the latest version of dhtmlxSuite Configuring Items DHTMLX Docs

Configuring Items

Setting/getting an item's text

To set the text of an item, use the setText() method:

mySidebar.items(id).setText({
    text: "new text",
    icon: "new_icon.png"
});

To get the text of an item, use the getText() method:

var text = mySidebar.items(id).getText(); // -> {text:"new text",icon:"new_icong.png", ...}

Related sample:  Item text manipulation

Showing/hiding an existing item

To show an item, use the show() method:

mySidebar.items(id).show();

To hide an item, use the hide() method:

mySidebar.items(id).hide();

Related sample:  Show/hide items

Adding/removing an item

To add an item, use the addItem() method:

mySidebar.addItem("itemId");

To remove an item from sidebar, use the remove() method:

mySidebar.items(id).remove();

Related sample:  Add/remove items

Setting/getting the active item

To select an item, use the setActive() method:

mySidebar.items(id).setActive();

To get the active item, use the method getActiveItem():

// get active item
var actvId = mySidebar.getActiveItem();
Back to top