Hi Niko,
Sorry for the inconvenience caused.
Query 1: 1. Shortly: Custom elements aren't working
a. Icon of custom element goes over first context menu element (see picture)
b. Custom element is not hoovered if cursor is on it, only default elements work (in screenshot cursor is not visible but its actually on Delete 2 element).
c. Click event is not received
Solution: For your kind information, it is mandatory to provide a value without a space , for the ‘menuId’ property in the contextMenuItems object. Please refer the below code snippet to add a custom menu item in TreeGrid.
$(function() { $("#TreeGridContainer").ejTreeGrid({ //... contextMenuOpen: oncontextmenu });
function customMenuClick(args) { alert("custom menu event trigggered"); }
function oncontextmenu(args) { args.contextMenuItems.push({ headerText: "Delete 2", menuId: "Delete2", iconPath: "url(folder-open.png)", eventHandler: customMenuClick }) } }); |
Query 2: 2: You demo shows that nested context menus are supported but how do I can do one? Debug information of event args is not usefull and no documentation eather.
Solution: We can add a sub context menu with the help of innerContextMenuItems in the event argument of contextMenuOpen. Please refer the below code snippet to add a sub context menu to the existing menu item.
$(function() { $("#TreeGridContainer").ejTreeGrid({ //... contextMenuOpen: oncontextmenu }); function oncontextmenu(args) { args.innerContextMenuItems.push({ headerText: "Inner Menu", menuId: "InnerMenu" }) } }); |
Is this not your requirement, please get back to us with more information.
Query 3: 3: I use 13.1.0.21 but screenshot is from 13.1.0.30. As you can see sub context menu is not visible, but it appears after adding one row. Like I say this is only 13.1.0.30 related.
Solution: Sub context items when adding a new row is based on the selected row, which contains above and below option to add a new row. But if the DataSource is empty we won’t get these items because we can not specify a position for new row to insert , and when a row is added ,now there are two possibilities to add above or below to the existing row , and hence a sub context menu appears in this case.
We have also prepared a sample based on this and you can find the sample under the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/119505/ze/ContextMenuId477560876
Please let us know if you need more information on this.
Regards,
Mahalakshmi K.
Hi Niko,
Sorry about the inconvenience caused.
Query 1: I think that there is no single word about menuId in your documentation, it probably should be fixed.
Solution: For your kind information, we have already logged a documentation task regarding this modifications and we are working on this currently , the documentation will be refreshed soon. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Query 2: But after some time wasting I noticed that reason was that my id was only numerical ("0", "1", "2"...)
Solution: currently Treegrid supports only string values as “menuId”. so we have also logged an issue report to to support numeric values as menuId. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Query 3: So is it possible to do submenus for more than one root element? And is it possible to do more than 2 levels context menus? And how about templates,
Solution: At present “innerContextMenuItems” is supported only for ‘Add’ option alone .And So we have logged a feature report on “support for submenus and template concept for Contextmenu” regarding this requirement. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Please let us know if you need further assistance on this.
Regards,
Mahalakshmi K.
Hi Krishna,
Sorry about the inconvenience caused.
Currently there is no support for event handlers to sub-context menu item in TreeGrid control. We have already logged feature report regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Please let us know if you require further assistance on this.
Regards,
Mahalakshmi K.
Hi Niko,
Sorry about the inconvenience caused.
Though the feature itself being valuable we have not yet planned to implement it, so as said in our previous update this will be implemented in any of our upcoming main release . We will let you know once this feature has been implemented.
Regards,
Mahalakshmi K.