Need help with custom spDropdowntree ng template for custom header menu widget on service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 11:53 AM
Hi Community,
I had recently customized the cart widget, and also had to clone the OOB header menu widget to accommodate the custom cart widget. I updated all the angular templates "menuTemplateCustom", "item-added-tooltipCustom.html", "spDropdownTreeTemplateCustom" on the custom header widget menu. I have created a custom directive, added angular providers to the widget and modified the ng-templates as shown below:
menuTemplateCustom
<li ng-repeat="item in item.items" ng-include="'menuTemplateCustom'" />
<sp-dropdown-tree-template-custom role="menu" aria-label="" ng-if="item.scriptedItems.count > 0" items="item.scriptedItems.items" />
spDropdownTreeTemplateCustom
<sp-dropdown-tree-template-custom ng-if="mi.type == 'menu' && mi.items.length" items="mi.items" />
I referred to this blog in doing the above https://www.servicenowelite.com/blog/2018/11/15/clone-the-header-widget.
I see the menuTemplateCustom and item-added-tooltipCustom.html is working fine,
however I cannot see the dropdown for one of my menu item(filtered list) on the header menu, and assuming there is an issue within the spDropdownTreeTemplateCustom?
Does anybody experienced this issue? any help would be appreciated. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 09:44 PM
If you are referring to the above linked article, then you would have created your own angular directive. So in your directive where the articles says to use the below code
link : function(scope, element, attrs, controller) { scope.getURL = function() { return 'spDropdownTreeTemplateCustom';
Note that'spDropdownTreeTemplateCustom' is NOT the same of your angular provider but the name of your angular template.
If you make that adjustment in your code then you should be fine.