The CreatorCon Call for Content is officially open! Get started here.

Data table filter not working

Mahesh23
Mega Sage

 

 


Hello,

I'm currently working on implementing a new list using the data table widget, and I've encountered some issues with enabling filters.

Upon the page load, I'm displaying data using server-side code as shown below:

javascript

 

 

 

 

 

var widgetParams = data.myTicketsArray[0]; 
widgetParams.window_size = options.maximum_entries || 10; 
widgetParams.show_keywords = true; 
widgetParams.show_breadcrumbs = true; 
console.log($sp.getWidget('widget-data-table', widgetParams)); 
data.widget = $sp.getWidget('widget-data-table', widgetParams);

 

 

 

However, when I trigger the tableSwitch function to update the table with different filters and parameters, the filter and keyword search options seem to be missing. Here's the code for the tableSwitch function:

 

javascript

 

 

 

$scope.tableSwitch = function() { 
var params = $scope.selected; 
params.show_breadcrumbs= true;
params.enable_filter = true
spUtil.get('widget-data-table', params).then(function(response) { 
$scope.data.widget = response; 
});
 };

 

 

 

Despite setting the enable_filter and show_keywords parameters within the tableSwitch function, these options don't seem to be reflected in the updated table.

 Any insights or suggestions would be greatly appreciated. Thank you!

2 REPLIES 2

Sohithanjan G
Kilo Sage

@Mahesh23 

 

1. Where are you adding the new filter & new table name ?

2. If you are setting with option schema, update the option schema which switching

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

Hello,

$scope.selected object has all options like table, filter, fields etc.