cases on service portal needs to open in new tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 01:51 AM
Hi,
There is widget to get the list menu of the case table on the service portal and share the code as below,Now the issue is whenever user opens SOC "All open cases", they are getting cases list, but when they click cntl+case,its not opening in new tab.so i have tried by using "if (window.event.ctrlKey) {
window.open(url); "in the end of client controller script , it works like only the list menu "All open cases" or "Action needed " opens in new tab whenever i click cntl+Open.But the requirement is whenever user click on "cntrl+case nuber",it needs to be opened in new tab
Client controller script:
<div class="panel-heading">
<h2 class="h4 panel-title">
{{::options.title}}</h2>
</div>
<ul class="list-group category-list" role="list" aria-label="${{{::options.title}}}">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in data.list">
</li>
</ul>
</div>
<script type="text/ng-template" id="category-template.html">
<div ng-click="caseFilterSelected(category)"
sn-focus="category.selectedFilter == data.selectedFilter"
ng-class="{true: 'text-active', false: ''}[category.selectedFilter == data.selectedFilter]"
tabindex="0" class="group-item group-item-primary">
<span class="block text-overflow-ellipsis category"
id="{{::category.myListFilter}}"
uib-tooltip="{{::category.myListFilter}}"
tooltip-placement="top"
tooltip-enable="!isTouchDevice()"
tooltip-append-to-body="true">
{{::category.myListFilter}}
<span class="sr-only">${items}</span>
</span>
</div>
</script>
data.list = [];
data.selectedFilter = $sp.getParameter('sel');
data.list = new sn_customerservice.SpotITCSMPortalService().getMyListsMenu("sn_customerservice_soc_case");
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 02:08 AM - edited 07-28-2023 02:13 AM
Hi,
Did you tried to use?
$window.open('https://www.google.com', '_blank');
example:
$scope.caseFilterSelected = function(category, event) {
var url = "csm?id=csm_my_lists&table=sn_customerservice_soc_case" + "&view=" + category.view + "&target_page_id=" + category.targetPageId + "&filter=" + category.query + "&sel=" + category.selectedFilter;
if (event.ctrlKey || event.metaKey) { // Check for Ctrl key (Windows) or Command key (Mac)
$window.open(url, '_blank');
} else {
$location.url(url);
}
};
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 02:28 AM
Hi Jean,
Yes i have tried it, its working as whenever i clicked "all open cases",directly opens in new tab even not clicking CNTL.So thats why i have added if condition.But its not working as expected,working for only list menu options instead of case record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 02:45 AM - edited 07-28-2023 02:46 AM
OK, could you try to change like this:
HTML:
.... <div ng-click="caseFilterSelected(category, $event)" .....
JS:
$scope.caseFilterSelected = function(category, event) {
var url = "csm?id=csm_my_lists&table=sn_customerservice_soc_case" + "&view=" + category.view + "&target_page_id" + category.targetPageId + "&filter=" + category.query + "&sel=" + category.selectedFilter;
$location.url(url);
if (event.which === 2 || event.ctrlKey || event.metaKey){
window.open(url, "_blank");
}
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 02:58 AM
Hi Jean,
Still not working, its working same as above.
Thanks,
Teja