Data Table Widget

sgmartin
Kilo Guru

Using the Data Table widget in the Service Portal that comes with Helsinki.   Cloned it so that I could make it work for me.   I added the table name (change_request) and added the fields I wanted to see.   That however doesn't seem to be what that field means when I edit the widget.   The widget defaults to 4 fields (Number,Category,Short Description and Approval).   I did not select all of these and actually added a couple others I wanted to see but they don't show.   I love the look of the table that it presents, but it's just not acting the way I expected.   What am I missing about customizing/configuring a widget?

48 REPLIES 48

I ended up using the Data Table from Instance Def widget because it seemed to have the least number of bugs.   I made a clone of it and made it work for me using multiple tables.



At the top:


data.title = input.title;




  if (data.title) {


  data.table_label = data.title;


  data.table_plural = data.title;   //   setting the title didn't seem to work in the config


  }


  data.color = "primary";   // did this because setting it in the widget config didn't work




After data.canCreate = gr.canCreate();


I used this for the multiple tables I was using.   One widget for them all.



switch (data.table) {


  case 'change_request':


  data.fields = 'number,type,u_business_unit,location,short_description,approval';


  break;



  case 'incident':


  data.fields = 'number,priority,state,assigned_to,u_business_unit,short_description';


  break;



  case 'sc_request':


  data.fields = 'number,requested_for,opened_by,request_state,due_date';


  break;



  case 'hr_cases':


  data.fields = 'number,short_description,category,cmdb_ci,location,opened_at,sys_updated_on';


  break;


  }



In the statement


data.fields = 'number,short_description,category,cmdb_ci,location,opened_at,sys_updated_on';


I am able to grab the columns that I need since adding them to the config didn't work.



I haven't see any issues with the pagination.  


cbester
Tera Contributor

Has anyone been able to get the show_keywords option to work? And, is there a way to change how a link opens? When I click on an incident on the simple list, it goes to the ticket form, but the data table from instance def goes to a different form.


cbester   for the show_keywords use the options and set it to true. I am using the Data Table from Instance Definition. If you go to the Server Script section you will see the "var widgetParams", in there set show_keywords: true, that should do the trick.



for the Data Table widget I had to go to "Edit schema options" and add a "show_keywords" boolean and then go into the widget options and check the Show Keywords option and it shows the Keyword Search box. its really odd!


in the Simple List widget if you want to change the view when you click on the link, go to the widget options and change the option under LINK TO THIS PAGE. it can be set to 'ticket' or 'form', for example.



Data Table out of box points to the 'form' when you click on a link, I change it to point to a 'ticket' view for one of my widget instances.



under "$scope.go = function(table, item)" in Client Scripts I added parms.id = 'ticket';


this widget has so many bugs! we are not on patch 5 yet.



by adding the "data.fields =" parameter to the Server Script I was able to get the fields I wanted to show on the Data Table widget.