version 17.1.20171.1017
We are using the ui-contextmenu jquery plugin to provide context menu to our hierarchial grid, on the parent rows.
First question:
ls this plugin still the recommended approach for providing context menus on igGrids?
We are now tasked with providing a different context menu for the child grids.
Second question:
If still the recommended approach, what is the recommended approach for supporting different context menus on the igHierarchicalGrid using this plugin?
Regards
Aidan
Hello Aidan,
Yes, the jQuery plugin is still recommended approach for having a context menu in the grid since we don't provide such functionality out of the box at the moment. Regarding your second question, what do you mean by supporting different context menus on the igHierarchicalGrid? Could you give me an example?
Regards,
Tsanna
we are using the hierarchicalgrid in order to show child grids.
On the parent grid we provide a context menu via right-click on a parent row.
The child grids now need their own (different ) context menu when user performs a right-click over a child row.
We would like to have separation of concerns here but since the child grid is embedded in a parent row and you can only attach a context menu to a known element and child grids are dynamic, we are forced to have one menu and completely hack the items etc depending on if we are on a parent row or not.
We would prefer a cleaner contained approach.
What I can suggest is that you create two separate instances of the context menu, one for the parent and one for the child grids. What is important in this case is that you attach the parent context menu higher in the DOM hierarchy compared to the child menu. Then in the child context menu handle the "beforeOpen" event and stop its event propagation in order to prevent the parent menu showing. I'm attaching a sample that demonstrates the approach.
Best regards,Martin PavlovInfragistics, Inc.