Editing the Service Portal Simple list widget - changing the view all to go to ?id=requests

Brendan Hallida
Kilo Guru

Hi all,

I would like to create a new simple lists widget for displaying requests and incidents, that direct users when they click 'View all' (1) to be directed to the same location as to when a user clicks 'view all requests' that is found under the Request menu item (2).

1.

find_real_file.png

2.

find_real_file.png

The code from the menu item that I believe directs a user to view all requests is below

var link = {};

link.title = gs.getMessage('View all requests');

link.type = 'link';

link.href = '?id=requests';

link.items = [];

t.items.unshift(link); // put this first

Does anyone know how I can incorporate the above code into the widget scripts?

Cheers,

Brendan

EDIT - For the attention of people of the future.   I hope the world is still going ok.

Here is the actual code that I changed in the widget.

This is the code found in the Client Script

  1. this.seeAll = function(){      
  2.         $location.search({      
  3.                   id: c.options.list_page_dv || 'list',      
  4.                   table: c.options.table,      
  5.                   filter: c.options.filter      
  6.         });      
  7.   }

I changed it to

  1. this.seeAll = function(){  
  2. $location.search({  
  3. id: c.options.list_page_dv || 'requests'  
  4. });  
  5. };
1 ACCEPTED SOLUTION

larstange
Mega Sage

Hi Brendan



First you need to clone the simple list widget, so you can modify the code.



The view all button in the simple list calls a function in the client script section called "seeAll()"



find_real_file.png



You need to modify this function to behave the way you want it to


this.seeAll = function(){


        $location.search({


                  id: c.options.list_page_dv || 'list',


                  table: c.options.table,


                  filter: c.options.filter


        });


  }


View solution in original post

2 REPLIES 2

larstange
Mega Sage

Hi Brendan



First you need to clone the simple list widget, so you can modify the code.



The view all button in the simple list calls a function in the client script section called "seeAll()"



find_real_file.png



You need to modify this function to behave the way you want it to


this.seeAll = function(){


        $location.search({


                  id: c.options.list_page_dv || 'list',


                  table: c.options.table,


                  filter: c.options.filter


        });


  }


Thanks for your reply Lars,



That set me on the correct path!



This is the code found in the Client Script


This is the code found in the Client Script


this.seeAll = function(){  


        $location.search({  


                  id: c.options.list_page_dv || 'list',  


                  table: c.options.table,  


                  filter: c.options.filter  


        });  


  }



I changed it to



this.seeAll = function(){


$location.search({


id: c.options.list_page_dv || 'requests'


});


};