Hi,
I am using contextmenu combined with treeview.
At first the ContextMenu Tree is created normally as I right-click one node of Tree View, after I go to another page and come back, ContextMenu Tree is re-rendered, however, it is not working anymore and it throws one error:
Uncaught TypeError: Cannot read property 'enableItems' of undefined
at VueComponent.beforeopen (SuiteTree.vue?0fa7:253)
at Observer.notify (observer.js?6607:89)
at ContextMenu.Base.trigger (base.js?54ff:149)
at ContextMenu.MenuBase.triggerBeforeOpen (menu-base.js?22d3:683)
at ContextMenu.MenuBase.openMenu (menu-base.js?22d3:645)
at ContextMenu.MenuBase.cmenuHandler (menu-base.js?22d3:470)
I use it according to the example given by https://ej2.syncfusion.com/vue/documentation/treeview/how-to/process-the-tree-node-operations-using-context-menu
<ejs-contextmenu id='contentmenutree' target='#treeview' :items='menuItems' :beforeOpen='beforeopen' :select='menuclick'></ejs-contextmenu>
I define three operations: rename, add and delete in menuItems.
The error is threw in the beforeopen function:
var contentmenutree = document.getElementById('contentmenutree').ej2_instances[0];
document.getElementById('contentmenutree') returns the component accordingly, but document.getElementById('contentmenutree').ej2_instances returns empty.