Steve6795508
Posts: 0
Joined: Wed Apr 09, 2014 2:22 am

Reset List with Data Filter

Hi
I have a List component with the Data Filter enabled. I also have the property data-filter-reveal=true set. The list and filter work perfectly and the user is able to select the required list entry and I have added code to the click to auto populate some other labels etc on the page. Again all works fine.

What I'm now trying to do is after the auto population, I want to reset the data filter back to blank so if they want to search another entry on the list, it will perform the same way as it did the first time.

What I have tried and got the closest to a solution is:
Appery("buildingItemSearch").prev().find("input").val("");
Now this does blank out the data filter but it doesn't implement the data-filter-reveal so the list stays visible. If I backspace once within the data filter the data-filter-reveal works and the list become invisible.

What I need is to eliminate the need to perform the backspace.

Can anyone please help?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Reset List with Data Filter

Hi Steve,

Please use code below instead of yours:
precode
Appery("buildingItemSearch").prev().find("input").val("").trigger("change");
/code/pre
Regards.

Steve6795508
Posts: 0
Joined: Wed Apr 09, 2014 2:22 am

Reset List with Data Filter

Brilliant - thanks Illya

Return to “Issues”