Firing action from tree grid views

So the Office Connector now is up and running and I've modified the code for the Open in Office action to also function from relationship items. Some time ago I also implemented a tree grid view that allows the user to navigate to documents through a system breakdown structure via the main grid. Seeing as it'd be a nice timesaver if users didn't have to open the document item before being able to use the Open in Office action, how would I have to go about adding that action to the tree grid view? I'll either have to be able to retrieve a relationship item that has a Document item as its related ID or to retrieve the ID of the Document displayed on the row the user rightclicks on.
  • Hello, The easiest way to add this action would be to edit the CUI element that controls the existing context menu of the Tree Grid View. You can do this by exposing the CommandBarSection ItemType to the TOC and searching for a Location of TGV Context Menu. In a default environment, you should only get one result from this search. From here you can add a new Menu to the context menu for all TGVs. When you open this new menu, you can set the JavaScript Method that should run when the user clicks on it. You can use the existing MSO_OpenInOffice method as a basis for creating this custom method to run from the TGV. If you are using 11.0 SP12+, you can also create your own custom CommandBarSection to avoid needing to add this new menu option globally to all TGVs. You can configure this option through the Linked Toolbar/Context Menu field on the Tree Grid View form. You can look here for an introduction to modifying and creating your own CUI elements. Chris
    Christopher Gillis Aras Labs Software Engineer
  • Luckily we're on 11.0 SP12, adding one action to all TGVs wouldn't be ideal since not all TGVs'll necessarily show document items in any way or form. I'll let you know how it turns out!