<style type="text/css">
.e-ejinputtext.e-filtertext.fill {
background: yellow;
}
</style>
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowSorting()
.AllowFiltering()
.AllowPaging()
.IsResponsive()
.Columns(col =>
{
……………………………………….
})
.ClientSideEvents(e => e.ActionComplete("complete")))
<script type="text/javascript">
complete: function(args) {
if (args.requestType == "filtering") {
// use this if condition if you want to highlight the last filtered column.
if (this.getHeaderTable().find(".e-filtertext").hasClass("fill"))
this.getHeaderTable().find(".e-filtertext").removeClass("fill");
for (var i = 0; i < this.model.filterSettings.filteredColumns.length; i++) {
// we have used current filtering column index. so while clearing the incident it highlight the cell when multiple columns are filtered
var index = this.getColumnIndexByField(args.currentFilteringColumn);
var cell = this.getHeaderTable().find(".e-filtertext").eq(index);
cell.addClass("fill");
}
}
}
</script> |
|
<style type="text/css">
.fill {
background: yellow;
}
</style>
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowSorting()
.AllowFiltering()
.AllowPaging()
.IsResponsive()
.Columns(col =>
{
……………………………………….
})
.ClientSideEvents(e => e.ActionComplete("complete")))
<script type="text/javascript">
function complete (args) {
if(args.requestType == "filtering"){
// use this if condition if you want to highlight the last filtered column.
if (this.getHeaderTable().find(".e-headercelldiv").hasClass("fill"))
this.getHeaderTable().find(".eheadercelldiv").removeClass("fill");
for (var i = 0; i < this.model.filterSettings.filteredColumns.length; i++){
// we have used current filtering column index. so while clearing the incident it highlight the cell when multiple columns are filtered
var index = this.getColumnIndexByField(args.currentFilteringColumn);
var cell = this.getHeaderTable().find(".e-headercelldiv").eq(index);
cell.addClass("fill");
}
}
}
</script>
|
<script type="text/javascript">
function complete (args) {
if(args.requestType == "filtering"){
// use this if condition if you want to highlight the last filtered column.
if (this.getHeaderTable().find(".e-headercelldiv").hasClass("fill"))
this.getHeaderTable().find(".e-headercelldiv").removeClass("fill")
for (var i = 0; i < this.model.filterSettings.filteredColumns.length; i++){
// we have used current filtering column index. so while clearing the incident it highlight the cell when multiple columns are filtered
var index = this.getColumnIndexByField(args.currentFilteringColumn);
var cell = this.getHeaderTable().find(".e-headercelldiv").eq(index);
cell.addClass("fill");
}
}
}
</script>
|