jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Clear grid filter
Tagged: grid filtering
This topic contains 8 replies, has 3 voices, and was last updated by nikesh_ap 6 years, 6 months ago.
-
AuthorClear grid filter Posts
-
$(‘#jqxgrid’).jqxGrid(‘removefilter’, “Price”, true);
It clears that particular filter, refreshes the grid but does not remove value from textbox (filterrow).
Any ideas?
Thank you!
Nick.Hi Nick,
Have you tried calling “refreshfilterrow” after you removed a filter?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Here taken from filter sample:
<script type="text/javascript"> $(document).ready(function () { var theme = getDemoTheme(); var data = generatedata(500); var source = { localdata: data, datafields: [ { name: 'name', type: 'string' }, { name: 'productname', type: 'string' }, { name: 'available', type: 'bool' }, { name: 'date', type: 'date' }, { name: 'quantity', type: 'number' } ], datatype: "array" }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxgrid").jqxGrid( { width: 685, source: dataAdapter, showfilterrow: true, filterable: true, theme: theme, selectionmode: 'multiplecellsextended', columns: [ { text: 'Name', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', datafield: 'name', width: 115 }, { text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220 }, { text: 'Available', datafield: 'available', columntype: 'checkbox', filtertype: 'bool', width: 67 }, { text: 'Ship Date', datafield: 'date', filtertype: 'date', width: 210, cellsalign: 'right', cellsformat: 'd' }, { text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' } ] }); $('#clearfilteringbutton').jqxButton({ height: 25, theme: theme }); $('#clearfilteringbutton').click(function () { $('#jqxgrid').jqxGrid('removefilter', "name", true); }); }); </script>
‘refreshfilterrow’ not working.
Hi nikitaso,
Sorry, but I do not see anywhere in the code a “refreshfilterrow” call. Which version do you use? Also to clear the filter row values, there’s also a method called “clearfilterrow”
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/I basically need to remove only one filter, lets say I applied 2 filters and I want to remove one of them using api.
http://bondsdemo.trademorebonds.com/grid-filter.html
Enter ‘an’ to ‘name’ col and 5 into ‘qty’ column, then ‘remove filter’. it removes ‘name’ filter and clears value from ‘qty’
http://localhost:1677/grid-filterrefresh.html << with ‘refresh’
Hi nikitaso,
“clearfilterrow” will clear the values in the filter row – that’s the method’s purpose.
“refreshfilterrow” will update the values in the filter row, if a column has applied filter.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comSo there is no way to clear one filter and leave others active?
Hi Peter,
Is there any way we can add a clear control to individual columns inside the filter TextBox?
Thanks,
Nikesh. -
AuthorPosts
You must be logged in to reply to this topic.