Custom Interactive filter not working

Sachintha
Tera Expert

 

The dashboard is based on the 'task_time_worked'  table, and I want to filter it by task type. But this filter is not working.

 

 

Sachintha_0-1686737589345.png

 

1 REPLY 1

codycotulla
Tera Guru

Hi, replace your filterTaskType() function content with this

var filter_message = {};
filter_message.id = "filter_tasktype"; //the unique id for your message handler;
filter_message.table = "task_time_worked";
filter_message.filter = "";
var taskType = $j("#filter_task_type").val();
if (taskType) {
  filter_message.filter = "task_sys_class_name=" + taskType;
}
//Need to call this to make the interactive filter work
SNC.canvas.interactiveFilters.setDefaultValue(
  {
    id: filter_message.id,
    filters: [filter_message],
  },
  false
);
if (taskType) {
  dbh.publishFilter(filter_message.table, filter_message.filter);
} else {
  dbh.removeFilter();
}

 Also, in the future please paste the code along with a screenshot. That will make answering your question easier.

Cody