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:

    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:


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


Related sample:  Show/hide items

Adding/removing an item

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


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


Related sample:  Add/remove items

Setting/getting the active item

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


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

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