cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Click event in list widget activates hyperlink

SOLVED
Highlighted
Participant

Click event in list widget activates hyperlink

Hello,

I'm trying to create a dynamic list. So that when an item in the list is clicked on, it sends me to another experience (i.e. activate a hyperlink) 


I'm currently populating the list with a JSON list and utilizing the "return JSON.parse(value)" function, and the list displays the Name column.
[{"Experience":"URL1","Name":"Name1"},{"Experience":"URL2","Name":"Name2"},{"Experience":"URL3","Name":"Name3"},{"Experience":"URL4","Name":"Name4"}]

 

So the question is, how do you go about utilizing the "Item click" event within the list widget to activate a hyperlink based on which item was clicked?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Click event in list widget activates hyperlink

You can do this without the use of the hyperlink widget. Add this function to your Home.js file and then call it on the 'Item Click' event of the list widget.

 

$scope.openExperience = function(){
  
  var list = $scope.app.view['Home'].wdg['list-1']['list'];
  var selection = $scope.app.view['Home'].wdg['list-1'].list.selectedRows;
  
  for(i=0; i<list.length; i++)
  {
    if(list[i].Experience == selection[0].Experience)
    {
      window.location = list[i].Experience;
    }
  }
}
1 REPLY 1

Re: Click event in list widget activates hyperlink

You can do this without the use of the hyperlink widget. Add this function to your Home.js file and then call it on the 'Item Click' event of the list widget.

 

$scope.openExperience = function(){
  
  var list = $scope.app.view['Home'].wdg['list-1']['list'];
  var selection = $scope.app.view['Home'].wdg['list-1'].list.selectedRows;
  
  for(i=0; i<list.length; i++)
  {
    if(list[i].Experience == selection[0].Experience)
    {
      window.location = list[i].Experience;
    }
  }
}