Closed 5im5im closed 8 years ago
Actually i have got a working example without changing contextmenu-Library. I totally agree with you about patching 3rd party libraries. :) Ok, here we go: my npm-versions for completness: angular version 1.4.x angular-ui-grid version 3.2.x angular-bootstrap-contextmenu 0.9.x
Controller part (just snippets):
$scope.gridOptions = {
...
rowTemplate: '<div context-menu="grid.appScope.contextmenuOptions()" >' + restOfTemplate + '</div>'
}
$scope.contextMenuData = [ ... ]; /* your usual contextMenuData */
$scope.contextmenuOptions = function() {
return $scope.contextMenuData;
};
Seems like a workaround has been provided. It's an issue with integration with another library, which isn't really covered in what we can fix (unless there was a dependency in that library - in this case, there's none)
Hi there
ContextMenu works fine, except in UI-Grid. They use an isolated scope so the scope is not that one context menu expect.
What ever UI-Grid provides the original scope via
grid.appScope
. I could only fix it if I edited the contextMenu JS in the last function which is very dirty to edit a 3rd party libary...So I can use the original scope and the context menu will be displayed. Has anybody experience with ui.bootstrap.contextMenu under UI-Grid?
thx and kind regards 5im5im