Data table widget not working

Mahesh23
Mega Sage

Hello,

 

On load of the page all incidents are visible to users. However, when user clicks on My incidents button no records displayed to user. I am passing new filter to data table widget using server.update() but its not working. Can someone help me to fix this ?

 

 

<button ng-click='activeRecord()'>
  My Incidents
</button>
<sp-widget widget="data.dataTableWidget"></sp-widget>
function($scope, spUtil, $location, spAriaFocusManager) {
    var c = this;

    // Set the initial active filter

    $scope.activeRecord = function() {
        // Update the filter with the new value
        $scope.data.filter = "active=true^caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe";
        // Reload the data
        c.server.update();
    };
}
(function() {

	data.user = gs.getUserID();
	if (!input) {
		data.table = 'incident';
		data.filter = 'active=true';
		data.view = 'default';
	}


	if (input) {
		console.log(input.filter)
		data.table = 'incident';
		data.filter = input.filter;
	}

	var widgetParams = {
		table:data.table,
		filter:data.filter,
		table_label : "Incident",
		fields : $sp.getListColumns(data.table, data.view),
		filterACLs : true,
		show_new : true,
		show_keywords : true,
		show_breadcrumbs : true,
		view : data.view,
		enable_filter : input.enable_filter || options.enable_filter == true || options.enable_filter == "true"
	};
	console.log(JSON.stringify(widgetParams))
	data.dataTableWidget = $sp.getWidget('widget-data-table', widgetParams);

})();

 

 

 

0 REPLIES 0