
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 08:27 AM
Hi everyone,
Do you have any idea how I can open a record from a list in new tab by changing the "data table from instance definition"?
I want to make the same behaviour as "target = _blank" in the HTML, but the widget doesn't use a "<a>" tag, it uses the go method in the scope.
NB: the standard redirect to the form of the record in the same tab.
Thank you.
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 02:20 AM
Hi This is the solution when you have something like this :
$scope.go = function(table, item) {
var parms = {};
parms.table = table;
parms.sys_id = item.sys_id;
parms.record = item;
$scope.ignoreLocationChange = true;
for (var x in c.data.list) {
c.data.list[x].selected = false;
}
item.selected = true;
$scope.$emit(eventNames.click, parms);
};
replace $emit by windows.open
$scope.go = function(table, item) {
var parms = {};
parms.table = table;
parms.sys_id = item.sys_id;
parms.record = item;
$scope.ignoreLocationChange = true;
for (var x in c.data.list) {
c.data.list[x].selected = false;
}
item.selected = true;
window.open( "/spdig?id=directig_consult&table="+parms.table+"&sys_id="+ parms.sys_id,"_blank");
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 08:44 AM
Hi Adil
You can use something similar, construct your url:
url = '?id=' + item.page + '&sys_id=' + ciHardware + '&product=' + item.sys_id;
and then with target navigate to this url.
Kristian!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 09:42 AM
Hi Kristian
it is not possible like this , because the go default method
$scope.go = function(table, item) {
var parms = {};
parms.table = table;
parms.sys_id = item.sys_id;
parms.record = item;
$scope.ignoreLocationChange = true;
for (var x in c.data.list) {
c.data.list[x].selected = false;
}
item.selected = true;
$scope.$emit(eventNames.click, parms);
};
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 08:59 AM
I don't think it is possible through instance options however we achieved the same using client script
$scope.getSummary = function () {
window.open("url");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 09:53 AM
Hi Raju
thank you for the answer
Im using standard issues and this is the code :
HTML
<tr ng-repeat="item in data.list track by item.sys_id">
<td class="pointer" ng-class="{selected: item.selected}" ng-click="go(data.table, item)" ng-repeat="field in data.fields_array" data-field="{{field}}" data-th="{{data.column_labels[field]}}">{{item[field].display_value}}</td>
</tr>
Client Script
$scope.go = function(table, item) {
var parms = {};
parms.table = table;
parms.sys_id = item.sys_id;
parms.record = item;
$scope.ignoreLocationChange = true;
for (var x in c.data.list) {
c.data.list[x].selected = false;
}
item.selected = true;
$scope.$emit(eventNames.click, parms);
};
So as you can see i'm not using open
Have you any other idea, i want to do that without changing the logic of the code, is there a way to modify the go method ?