ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: angelahlp on March 03, 2014, 02:01:52 am

Title: Clear Filters
Post by: angelahlp on March 03, 2014, 02:01:52 am
Is there an easy way to clear all filters?
Title: Re: Clear Filters
Post by: paramvir on March 03, 2014, 10:04:26 am
Easy way to turn off all filters is by setting on:false in the filterModel.

http://paramquery.com/pro/api#option-filterModel
Title: Re: Clear Filters
Post by: angelahlp on March 03, 2014, 10:50:05 am
I've added this button to my grid toolbar but when clicked it does nothing?

                { type: 'button', label: 'Clear Filters', listeners: [
                    { "click": function (evt, ui) {
                        $grid.pqGrid( "option", "filterModel", { on: false } );
                    }
                    }
                ]
                },
Title: Re: Clear Filters
Post by: paramvir on March 03, 2014, 11:13:35 am
Method 1:

Call refreshDataAndView after setting on : false
Code: [Select]
$grid.pqGrid( "option", "filterModel", { on: false } );
 $grid.pqGrid( "refreshDataAndView" );

Method 2:

Code: [Select]
$grid.pqGrid( "filter", { oper:'replace', data: [] } );
Title: Re: Clear Filters
Post by: angelahlp on March 03, 2014, 12:38:49 pm
Thanks! That last line did the trick!  :)