BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.data)
.AllowFiltering()
.ClientSideEvents(events => events.Load("onLoad"))
. . .
. . .
)
<script type="text/javascript">
function onLoad(args){
this.model.filterSettings.filteredColumns = [
{"value":new Date("07/04/1996"),"operator":"greaterthan","field":"OrderDate","predicate":"or","matchcase":true},
{"value":new Date("07/12/1996"),"operator":"lessthan","field":"OrderDate","predicate":"and","matchcase":true}
]
}
</script> |
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.data)
.AllowFiltering()
.ClientSideEvents(events => events.Load("onLoad").DataBound("dataBound"))
)
<script type="text/javascript">
function dataBound(args){
this.element.find(".e-filterbar").addClass("e-hide");
}
</script> |
@(Html.EJ().Grid<object>("FlatGrid")
.AllowFiltering()
. . .
)
<script type="text/javascript">
$(function () {
$("#btn").ejButton({
text: "clear filter",
click: function (args) {
var obj = $("#Grid").ejGrid("instance");
obj.clearFiltering();
}
})
});
</script> |
<script type="text/javascript">
$("#btn2").ejButton({
text: "Remove One Operator",
click: function (args) {
var obj = $("#Grid").ejGrid("instance");
var fcols = obj.model.filterSettings.filteredColumns;
var filterObj = ej.DataManager(fcols).executeLocal(new ej.Query().where("operator", "equal", "lessthan"))[0];
var inx = fcols.indexOf(filterObj);
obj.model.filterSettings.filteredColumns.splice(1, inx);
obj.refreshContent();
}
})
</script> |
@(Html.EJ().Grid<object>("FlatGrid")
.AllowFiltering()
. . .
)
<script type="text/javascript">
$("#btn1").ejButton({
text: "Filter",
click: function(args){
var obj = $("#Grid").ejGrid("instance");
obj.model.filterSettings.filteredColumns = [
{"value":new Date("07/04/1996"),"operator":"greaterthan","field":"OrderDate","predicate":"or",type: "date","matchcase":true},
{"value":new Date("07/12/1996"),"operator":"lessthan","field":"OrderDate","predicate":"and",type: "date", "matchcase":true}
];
obj.refreshContent();
}
})
</script> |