DataTable row click - change url

testing2
Tera Contributor

I am trying to modify the existing set of DataTable widgets (base DataTable and via Instance) and having issues understanding how the row click operation is designed.   When you click on a specific row for any given table, the record is sent to the id=form widget.   I would like to be able to change this behavior, but I cannot see where the id is set or even really understand what function in the widget is managing the redirect.

go is the on-click event of the row:

$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);

  };

I also see this code around a lot and I am do not know what it does: $location.search(search);

If somebody could help me understand how this function results in a redirect to the form widget, that would be super helpful, or even where in the DataTable widgets the form widget is being set (if it is).

Thanks!

1 ACCEPTED SOLUTION

I found that Page_id does exist on the instance table and I needed to add it to the form in order to see it and enter information.


View solution in original post

5 REPLIES 5

I think I found it.



I opened "Widget Instances" table, selected my instance record and added to the form field "Link to this page".


This value is then used in data table for redirection.