Forum Discussion
Further discoveries include: Edit ui_resources.xml to then be able to use the function aras.getResource and use dynamic text...
...resulting in:
Here, the icon is an svg, using the "use" tag to pull in shared resources. I just found the pointer to ItemType icon and replaced the use xlink:href to end with: #svg-itemtype
The click currently still just does an alert with:onclick="${() => alert(secondaryMenuData.itemTypeId)}"
The code change in NavigationPanel.js was to tack this on ~ln123 for a third button. The inline styling is just me figuring stuff out w/o touching the CSS (because I'd add a ...__secondary-menu-goto-button style, but I don't know yet how to make the JS get re-minified, trigger a build or whatever). And... I cannot just paste this and don't have the time so a pictue of code:
So... my ask is:
How to utilize the onclick in conjunction with the item type id we already have available?
Hi Neil,
Since you already have the ID of the ItemType, you can use a handy function on the aras object to open up the associated ItemType.
aras.uiShowItem("ItemType", secondaryMenuData.itemTypeId);
You can also uiShowItem to open any item in the database, not just ItemTypes. The first argument is a string of the name of the ItemType you want to open and the second argument is the ID of the item you want to open. For completeness, I'll also mention that there are more arguments that you can pass in to uiShowItem, but in almost all use cases, you'll only need to use the ItemType name and item ID.
Chris
- neil_lindberg6 years agoIdeator I
Mind blown!
To me, I prefer this sort of fix rather than just the context menu - but, I think it makes sense to also add to the right-click [ "New", "Search" ] functionality for any item type, for admin usage, a button/link/option that takes you to the ItemType.
So nice! Thanks a bunch,. I feel one change I have is not a hack. Sweet!