-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to open context menu on right click, using Angular 7? #248
Comments
Are you talking about this example, shown at the bottom? I've never done any implementation or need such thing, but you can easily reproduce by using the SlickGrid grid object (and maybe the DataView object as well) directly. It's not a plugin or anything, it's just plain DOM element with jQuery events attached to them. I'm sure you can reproduce that easily, following the SlickGrid Context Menu code. |
We have implemented this functionality using a mix of jquery code. <ul id="contextMenu" style="display:none;position:absolute">
<b>Set priority:</b>
<li data="Low">Low</li>
<li data="Medium">Medium</li>
<li data="High">High</li>
</ul> And then define a method in your component to actually show the context menu contextMenu(e) {
console.log('Event ',e);
e.preventDefault();
const eventData = e.detail.eventData;
var cell = this.angularGrid.slickGrid.getCellFromEvent(e);
var x = e.pageX - 250;// $(e.target).offset().left;
$("#contextMenu")
.data("row", cell.row)
.css("top", e.pageY)
.css("left", x)
.show();
$("body").one("click", function () {
$("#contextMenu").hide();
});
} And finally calling this in rowSelection event like |
Thanks for the code sample, I knew it wasn't that hard to implement with raw javascript/jQuery code.
jQuery is a dependency of this library, so you have no choice but to have it installed 😉 |
not yet released it will come in the new year |
@doll612 @coolrb Cheers ⭐️ |
Thanks, @ghiscoding. |
General Question, Topic
Your Environment
Context
Expected Behavior
Current Behavior
Possible Solution
Code Sample
Thanks,
The text was updated successfully, but these errors were encountered: