Service Poartal - Filter Breadcrumbs widget issue - The filter condition field is not updated

kyzzy
Tera Expert

Hi,

The Filter Breadcrumbs widget fails to accommodate the dynamically changing table field list. When switching tables to apply a filter condition, the current table's fields are not accessible in the condition field; only the fields from the initially loaded table are displayed.

Can you help me solve the problem?

1 ACCEPTED SOLUTION

kyzzy
Tera Expert

I have resolved the problem.

Problem: The Filter Breadcrumbs widget updates the field list when switching tables dynamically from the Data Table widget. The issue is that the filter widget still shows fields of the initially loaded table instead of the new one.

Solution: I need to broadcast the table update event and update the filter widget explicitly after switching tables so it can reload the new table's field list.

Added lines to the Data Table widget:

$scope.$broadcast("snfilter:update_table", {table: selectedTable});

 

if ($scope.options.show_breadcrumbs && data.filterBreadcrumbs)
$scope.$broadcast("widget-filter-breadcrumbs.updateTable", {table: selectedTable});

View solution in original post

2 REPLIES 2

kyzzy
Tera Expert

I have resolved the problem.

Problem: The Filter Breadcrumbs widget updates the field list when switching tables dynamically from the Data Table widget. The issue is that the filter widget still shows fields of the initially loaded table instead of the new one.

Solution: I need to broadcast the table update event and update the filter widget explicitly after switching tables so it can reload the new table's field list.

Added lines to the Data Table widget:

$scope.$broadcast("snfilter:update_table", {table: selectedTable});

 

if ($scope.options.show_breadcrumbs && data.filterBreadcrumbs)
$scope.$broadcast("widget-filter-breadcrumbs.updateTable", {table: selectedTable});

kyzzy
Tera Expert

These parts can be completely removed:

if ($scope.options.show_breadcrumbs && data.filterBreadcrumbs)
$scope.$broadcast("widget-filter-breadcrumbs.updateTable", {table: selectedTable});