BoldDesk®Customer service software with ticketing, live chat & omnichannel support, starting at $99/mo for unlimited agents. Try for free!
Does anybody have an example of adding a contextmenu to a listbox?
I'm struggling to get the item data for the item selected.
FYI, we also need to have multiple listboxes on the same page with different menus
Thanks
Richard
this.selectFunction = (args) => {
console.log(values);
};
this.beforeOpen = (args) => {
values = [];
values.push(args.event.target.getAttribute('data-value'));
}
}
render() {
return (
<div id="listbox-control">
<h4>Select your favorite car:</h4>
<ListBoxComponent
id="listbox1"
dataSource={this.data}
/>
</div>
<div id="contextmenu-control">
<div id="contextmenutarget">{this.content}</div>
<ContextMenuComponent
target="#listbox-control"
items={this.menuItems}
beforeOpen={this.beforeOpen}
select={this.selectFunction}
/>
</div>
);
}
}
|
Thanks for the reply.
We'll have a go at this. I think the problem we had was sorting out the context menu target but your example makes that clearer.