Hi,
I have added a image to filter row of grid. On click of the image it clears the filters in the filter menu.
var clearFilterImage = function (column, columnelement, widget) {
var FilterContainer = $(‘<div></div>’);
var ClearFilterContainer = $(‘<div></div>’);
ClearFilterContainer.attr(‘style’, ‘position:absolute; z-index:20000; padding-left:15px;padding-top:7px;’);
ClearFilterContainer.attr(‘id’, ‘divClearFilter’);
var imgAction = $(‘
‘);
imgAction.attr(‘id’, ‘imgClearProjectFilter’);
imgAction.attr(‘src’, ‘../Img/clear.png’);
imgAction.attr(‘alt’, ‘Clear filter’);
imgAction.attr(‘align’, ‘middle’);
imgAction.attr(‘style’, ‘cursor: pointer;’);
imgAction.attr(“onclick”, “$(‘#jqxgrid’).jqxGrid(‘clearfilters’);”);
ClearFilterContainer.append(imgAction);
FilterContainer.append(ClearFilterContainer)
columnelement.html(FilterContainer.html());
}
Below is the command column in the grid(edit icon, delect icon)
{ width: ’70px’, menu: false, filterable: true, align: ‘center’, sortable: false, resizable: false, editable: false,
renderer: headerActionRenter, cellsrenderer: cellsEditRenderer, createfilterwidget: clearFilterImage
}
this is working fine. but when you group by some column in the grid. this image is cleared.
i think, as soon as you group by some column, the filter row is re rendered.
please let me know what can we do for this?
Thanks,
Kiran