Remove Filter Conditions for a "New search" Button on Portal Data Table Widget

taylor21
Mega Expert

Hi all,

I am working on a data table widget on the portal and in order to avoid causing confusion with removing the breadcrumbs via clicking the > I have made a "New search" button next to the search bar. I am trying to make this button remove the filter conditions that they have added onto the fixed condition that exists. Here is a screenshot for clarity:

find_real_file.png

I have inspected the > on the page to see what is being used to remove the filters which is seemingly the following line in the HTML:

ng-click="adjustFilter(crumb, true)"

However, when I add this to the HTML for the button, I am not getting any results. I am new to HTML and JavaScript so I'm sure there is a piece I am missing here (in the client script maybe?).

 

Reloading the page removes all of the filters. If possible, if I could just reload the widget only (not the whole page) and have the same result, that would suffice! However, I am also unsure of how to do that.

 

Any help with this is greatly appreciated!

 

Taylor

1 ACCEPTED SOLUTION

taylor21
Mega Expert

I found a solution, I added this to the HTML of my button:

 

ng-click="clearSearch()"

 

And added this to my client script:

 

$scope.clearSearch = function(){  

        $scope.data.filter = c.data.storef;

        $scope.setSearch(true);

};

 

View solution in original post

1 REPLY 1

taylor21
Mega Expert

I found a solution, I added this to the HTML of my button:

 

ng-click="clearSearch()"

 

And added this to my client script:

 

$scope.clearSearch = function(){  

        $scope.data.filter = c.data.storef;

        $scope.setSearch(true);

};