Cell's Right-click event on relationship tab

I have a parent Item 'Matrix'. Matrix has a relationship tab called 'Project Documents', which is loaded by an onBeforeGet Method. 'Project Documents' is a Relationship Item with several properties, each one is mapped to a specific 'Document' Item. Now I want users to be able to right-click on a cell and the system to know which cell has been clicked on. Either I want to change the Right-Click Menu, Or I want the selected action to know which cell was clicked. The closest I have come to finding an answer is with event handles, but I don't know where I would need to attach the code. GridContainer. Event:gridMenuInit Method Any Help would be greatly appreciated. Many thanks, Martin
  • Hi Martin, The easiest way to accomplish this would be to add an Item Action to the Project Documents relationship ItemType. Item Actions will automatically be added to the Right-click menu of the relationship grid. You can then look up the value of the selected cell using code like the sample below.
    // Get the grid
    var relationshipsId = window.relationshipsControl.currTabID;
    var relationshipsFrame = window.frames[relationshipsId];
    var gridApp = relationshipsFrame.contentWindow.gridApplet;
    // Get the value of the selected cell
    var selCell = gridApp.getSelectedCell();
    var cellValue = selCell.getValue();
    Please note that there is currently a bug filed with the getSelectedCell() method where it returns incorrect results if the relationship grid displays a mix of properties on the related ItemType as well as on the relationship ItemType. Chris
    Christopher Gillis Aras Labs Software Engineer
  • This looks like it will solve my problem. Many thanks, Martin