Hello,
is it in Sidebar possible to have an ‘onClick’-event?
regards,
Laurens
Hello,
is it in Sidebar possible to have an ‘onClick’-event?
regards,
Laurens
Hello
It is onSelect event
docs.dhtmlx.com/api__dhtmlxsideb … event.html
What do you need this onClick event for?
I need an event which starts everytime when clicking on the item. even if you already selected it.
The ‘select’-event starts only once when you have selected it.
regards
Laurens
Hi
you can try the following:
var mySidebar = new dhtmlXSideBar({
...,
items: [
{id: "recent", text: "Recent", icon: "recent.png"},
{id: "desktop", text: "Desktop", icon: "desktop.png"},
{id: "downloads", text: "Downloads", icon: "downloads.png"}
]
});
mySidebar.attachEvent("onSelect", function(id){
// do your stuff here, for example
console.log(id);
// reset saved selection (allow select the same item)
this.conf.selected = null;
});
mySidebar.goToNextItem(true); // sleect first item and trigger onSelect event
note, no one item is selected in config, first (onload) selection performed by goToNextItem function
Thanx,
That was the trick.
regards,
Laurens