Hi Abu,
I tried to use some code in this forum for resetting or clearing the filter.
Button appears, but I get an sql error when it tries to refresh.
http://websalesdesign.com/proj/lib/phpgrid-full/demos/appearence/alternate-row.php
http://websalesdesign.com/proj/lib/phpgrid-full/index.php
Below is the code.
</script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : 'Reload',
'buttonicon' : 'ui-icon-refresh',
'onClickButton': function()
{
var myGrid = jQuery("#list1");
jQuery("span.s-ico",myGrid[0].grid.hDiv).hide(); // hide sort icons
// reset filters and sort field
myGrid.setGridParam({ postData: { filters: JSON.stringify({groupOp: "AND", rules:[]}) }, sortname: ''}).trigger('reloadGrid');
// empty toolbar fields
jQuery(".ui-search-input input").val("");
},
'position': 'last'
});
});
</script>
Ok, the lib will need a fix for this tweak.
Edit jqgrid_dist.php:
Search:
$qwery = " AND ( $qwery )";
Replace with:
if (!empty($qwery))
$qwery = " AND ( $qwery )";