locked
LS2013 HTML Client: How to clear all filters on a browsing page? RRS feed

  • Question

  • Hello,

    We have a browse screen that displays a list of questions that can be filtered using the usual LS query based methods.  If a user has applied several filters, I want to give him/her a quick way to reset to the beginning and see all of the unfiltered data.  So, I've added a "Clear Filters" command button to the screen and wrote a handler for it.  My initial thought was to simply refresh() the data source, but it did not work.  The list of filtered data remained.  Next, I thought about clearing each of the filter fields, but it did not work. 

    Attached is an image showing where multiple filters have been applied, and the button.

    Here is the command button's handler:

    myapp.SearchQuestions.ClearFilters_Tap_execute = function (screen) {
        // Reload the list to display all of the data.
        screen.QuestionDisplayAsFilter = '';
        screen.BodyFilter = '';
        screen.ContextIdFilter = -1;

        screen.QuestionsSorted.refresh();
    };

    I'd appreciate any ideas about how to accomplish this task.

    Thank you for your time and suggestions,

    Mike


    Friday, November 8, 2013 5:30 PM

Answers

  • ... I decided to make the command button on the search screen simply navigate to the search screen.  This forced a reload of the page, which reset everything.  Is this the best method to clear filters?

    Thanks for your help!

    Mike

    • Marked as answer by Angie Xu Monday, November 25, 2013 7:19 AM
    Friday, November 8, 2013 5:38 PM

All replies

  • ... I decided to make the command button on the search screen simply navigate to the search screen.  This forced a reload of the page, which reset everything.  Is this the best method to clear filters?

    Thanks for your help!

    Mike

    • Marked as answer by Angie Xu Monday, November 25, 2013 7:19 AM
    Friday, November 8, 2013 5:38 PM
  • You clould also have a try refresh entire screen, and check whether it is helpful to clear all filters.

    Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 12, 2013 12:36 PM