Row right click event for grid
Hi all, Did the ng-grid support row right click event? I want to add a popup context menu for each row. But the grid doesn't support the right click row selection. Any solution for this case?
You can accomplish that using ng-context-menu (https://github.com/ianwalter/ng-context-menu) directive in your rowTemplate.
rowTemplate: '<div>' +
' <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" ui-grid-cell context-menu data-target="myMenu"></div>' +
'</div>',
<div class="dropdown position-fixed" id="myMenu">
<ul class="dropdown-menu" role="menu">
<li>
<a class="pointer" role="menuitem" tabindex="1"
ng-click="panel.highlight = true">
Menu 1
</a>
</li>
<li>
<a class="pointer" role="menuitem" tabindex="2"
ng-click="panel.highlight = false">
Menu 2
</a>
</li>
<li>
<a class="pointer" role="menuitem" tabindex="3"
ng-click="panel.highlight = false">
Menu 3
</a>
</li>
</ul>
</div>
Thanks @codesometech. It works !
No its not working man !!! i am facing a problem as this
TypeError: Cannot read property 'cellTemplate' of undefined
at ngGridDirectives.directive.ngCell.compile.pre (http://angular-ui.github.io/ng-grid/lib/ng-grid.debug.js:3094:50)
at j (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:42:195)
at e (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:38:207)
at j (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:42:255)
at e (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:38:207)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:37:339
at Object.
how can i pass row id to context menu?
Thanks to @codesometech
It works fine.
The only matter is that I add the
Hi @codesometech,
Where should I put the drop down code? If I put it in the index.html, then the menu is displayed as a list in the landing page.
I'm also getting incorrect position when context-menu placed inside rowTemplate. @savokiss, @codesometech, how do you get the current row then?
@eMazeika --did u get any succcess?
If you have got a solution, please share with me ...
Thanks in advance :)
@tr3567, I've got this working: http://stackoverflow.com/a/34019441/1072921
@eMazeika ---Can you please give me a link to your working code?
Thank you :)
@tr3567, we're using ui-grid in our e-commerce platform. Check Virto Commerce Manager: https://admin-demo.virtocommerce.com
Login credentials: admin/store
Navigate to: More -> Catalog
@eMazeika ---Thank you so much...
Bro you have created context-menu for each row...
How do I do the same for each column header?
I am new to ui-grid, so please forgive me for troubling you so much :P
@tr3567 , there is menu out of the box for column header. If you insist for context menu, it should be very similar - override the default template.
@eMazeika --how do I do that?
Where exactly should I make the change?
can you please post the entire code to display context menu on right click. I am completely new to ui-grid and angularjs
I would also like to know entire code to display context menu on right
click On Wed, Mar 14, 2018 at 4:09 PM, bpallavi [email protected] wrote: can you please post the entire code to display context menu on right
click. I am completely new to ui-grid and angularjs —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/angular-ui/ui-grid/issues/3532#issuecomment-372976981,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKAEmOylE22zze6IvAyaWAS7u2S38rSnks5tePN3gaJpZM4EgG7_
. -- Regards,
Yogesh
I would also like to know entire code to display context menu on right
click On Wed, Mar 14, 2018 at 4:09 PM, bpallavi [email protected] wrote: can you please post the entire code to display context menu on right
click. I am completely new to ui-grid and angularjs —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/angular-ui/ui-grid/issues/3532#issuecomment-372976981,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKAEmOylE22zze6IvAyaWAS7u2S38rSnks5tePN3gaJpZM4EgG7_
. -- Regards,
Yogeshdropdown code in my parent dom instead of withing the rowTemplate.Or the position isn't right.