Imagine you want to add to a context menu an action "Open in Diagram" for every item link column, and also taskLink column.
You put into risksheet_topPanel.vm
<script> risksheet.customContextMenuActions ={ "openInDiagramAction":{ "label":"Open in Diagram", "function":"openInDiagram", "isEnabledFunction":"isOpenInDiagramEnabled" } }; function isOpenInDiagramEnabled(item, col){ console.log("isDoEnabled",item,col) return col.type==="itemLink" || col.type==="taskLink"; } function openInDiagram(item,col){ let project = risksheet.projectId; let linkId=item[col.id]; if(col.type==="taskLink" && linkId.indexOf('!')!=-1){ const idArray = linkId.split('!'); project = idArray[0]; linkId = idArray[1]; } //replace with real diagram url .... window.open(`/polarion/#/project/${project}/workitem?id=${linkId}`) } </script>
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article