Creating 2 seperate menus on a dGrid tree

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Creating 2 seperate menus on a dGrid tree

Harry Devine
I have a dGrid using the Tree mixin.  I'm on version 0.3.16 currently.  I can create a menu by listening for the .dgrid-row:contextmenu event and display the menu.  However, I would like to have 1 menu displayed when the user clicks on a parent node of the tree, and a separate menu displayed on a child node click.  I'm not sure how to accomplish this.  Here's how I'm making the menu currently:

var activeItem;

grid.on(".dgrid-row:contextmenu", function(evt){
  evt.preventDefault(); // prevent default browser context menu
  row = grid.row(evt);
  mod.activeItem = row &&;

var menu = new Menu({
  targetNodeIds: [grid.domNode]

menu.addChild(new MenuItem({
  label: "Remove",
  iconClass: "delete",
  onClick: function() {
  if (mod.activeItem) {
      console.log("Clicked on ", mod.activeItem);

Any thoughts?



Dojo Toolkit:

[hidden email]
To unsubscribe, visit: