contextmenu.attachTo, tree.webix_kids and tabbar extra tabs popup questions

  1. $$(‘contextmenu1’).attachTo(document.getElementById(“myElement”)); doesn’t seem to work, setPosition works with element x, y coordinates tho.

  2. webix_kids:true doesn’t work with tree.add (does not display the +)? this works: tree.parse([{ value:‘test’, webix_kids:true }]); but this does’t: tree.add({ value:‘test’, webix_kids:true }); - how to get it working with tree.add?

  3. with tabbar extra tabs popup, is there a way to exclude/hide some entry from the list?

  4. is there a way to append ‘Close’ option to the tabbar extra tabs popup (which doesn’t select anything, just closes the popup)?

(1) works locally. Please share a snippet or a demo link

(2) yes, I can confirm the behavior. As possible workaround, you can use

tree.getItem(newid).$count = -1;
tree.refresh(newid);

(3), (4) tabbar.getPopup().getList() will give you list items, so you can add or remove options. You will need to do it from onAfterRender event of tabbar, as data in the list is fully reloaded after changing the active tab.

Thanks for response! I will give these a try. I will check the attachTo again and provide a sample if I can’t get it working, but setPosition solved it so it’s not a priority :slight_smile:

  1. If there is only one child, it doesn’t work. So the workaround requires some if( data.childs > 1 ) tree.getItem(newid).$count = -1; to work.

Got everything working now, thanks :slight_smile: