- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 12:51 AM
Hello All,
I am looking for help with the following request.
I have displayed some list of CIs using the following code in a widget
But whenever a record is selected out of the list I want that to redirect to a new Widget (on click of the record).
How to acheive that?
Window url is not going to work. how to make it work on selection of the record from the list
<div class="panel panel-primary">
<div class="panel-heading">
<h1 class="bg-primary">Client CIs
</h1>
</div>
<ul class="list-group result-container">
<li ng-repeat="inc in data.incident" ng-model = "c.fname" ng-click="c.openPopUp">
<a href>{{inc.ci}}</a>
</li>
</ul>
</div>
<!--<sp-widget widget="data.example"></sp-widget> --
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.incident=[];
data.user = gs.getUserID();
var gruser_list = new GlideRecord('cmdb_rel_person');
gruser_list.addQuery('user',data.user);
gruser_list.query();
var results = [];
while(gruser_list.next())
{
var inc = {};
//inc.user = gruser_list.getDisplayValue('user');
inc.ci = gruser_list.getDisplayValue('ci');
data.incident.push(inc);
}
//data.example = $sp.getWidget('demo', {});
})();
I have a widget to display some set of CIs
function($scope, $rootScope){
var c = this;
c.test = function()
{
c.data.tempname = c.fname;
var test = c.data.tempname;
alert(test);
$rootScope.$broadcast('xyz',test);//key - value function
//data.example = $sp.getWidget('demo', {});
c.openPopUp = function() {
var url = gs.getProperty() +"/sp";
var popup = window.open (url, "popup", "width=900, height=600");
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 01:13 AM
you need to replace the ng-click to below.You missed the paranthesis
ng-click="c.openPopUp()"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 01:13 AM
you need to replace the ng-click to below.You missed the paranthesis
ng-click="c.openPopUp()"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 01:24 AM
My bad, It worked! thanks much!