#100890
Hristofor
Member

Hi Tr12,
1) Currently there is no way to add more than 1 item at a time. However we will consider adding such functionality.
2) The Smart.Tree does not throw any specfic events regarding context menus, so you will have to add your own. Here’s how to do it:


window.onload = function () {
const tree= document.querySelector('smart-tree');
tree.addEventListener('contextmenu', function (event) {
const target = event.target;
//Get the target item
const item = target.closest('smart-tree-item'),
itemGroup = target.closest('smart-tree-items-group');
if (!item && !itemGroup) {
return;
}
//Prevent browser's context menu
event.preventDefault();
//Open a Smart.Menu
})
}

Best Regards,
Christopher
Smart HTML Elements Team
https://www.htmlelements.com