Clearing Filter criteria

  • As we don't have any clear option for clearing the search criteria,
    I am using "Clear Filter" button above the grid to clear the filter criteria when user clicks on it.

    FYI - i am using ext 2.0 & filters as plug-ins
    here is my code

    Ext.get('ClearFilter0').on('click', function()
    {
    filters.clearFilter();
    }
    );
    above code clears the filter results from the grid - perfect
    but retains the check box selection in the filter (filter plug-in in the grid).

    for eg.
    1. if i do a date filter - selecting "on" - "Today"
    Filter results displayed in the grid.
    2. Click on "Clear Filter" button
    Filter results gets cleared and displays all the records in the grid. but search criteria checkbox ie selected value "on" - "Today" remains selected.

    can we clear this also while clearing search results???


  • Didn't I already anwser this in the other thread?

    Here's the patch again:
    Ext.override(Ext.grid.filter.DateFilter, {
    setActive: function(active, suppressEvent) {
    if (this.active && !active) {
    this.dates.on.setChecked(false, true);
    this.dates.before.setChecked(false, true);
    this.dates.after.setChecked(false, true);
    }
    Ext.grid.filter.DateFilter.superclass.setActive.ca ll(this, active, suppressEvent);
    }
    });


  • No Boss!!!

    The issue is not only with the Date Filter but its with all other filters too..
    (not induced due to my earlier fix)

    For Eg,
    1. if i do a numeric filter - selecting "=" & "10"
    Filter results displayed in the grid.
    2. Click on "Clear Filter" button
    Filter results gets cleared and displays all the records in the grid. but search criteria checkbox ie selected value "=" - "10" remains selected.

    can v clear this info??


  • Gr8!!! Awesome!!! works fine!!!
    i am sorry i didn't understand at first, I mean in the earlier thread.
    i got lots of appreciations from my boss for fixing the issues around filters on time!!! :D

    hats off to u!!!
    Thanks a ton again!!!:)


  • Same principle:
    Ext.override(Ext.grid.filter.NumericFilter, {
    setActive: function(active, suppressEvent) {
    if (this.active && !active) {
    this.menu.fields.gt.setValue(null);
    this.menu.fields.lt.setValue(null);
    this.menu.fields.eg.setValue(null);
    }
    Ext.grid.filter.NumericFilter.superclass.setActive .call(this, active, suppressEvent);
    }
    });







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Clearing Filter criteria , Please add it free.