Hi Brian,
We have analyzed your requirement and achieved it by using filterBarTemplate feature of Grid control and please refer to the below code example.
<ej-grid id="FlatGrid" datasource="ViewBag.dataSource" allow-paging="true" allow-filtering="true">
. . .
<e-columns>
. . .
<e-column field="ShipCountry" header-text="Ship Country" filter-bar-template="@(new FilterBarTemplate() {Create="create", Read="read",Write="write" })">
</e-column>
</e-columns>
</ej-grid>
<script type="text/javascript">
function create(args) {
return "<input>";
}
function write(args) {
//Bind the keyup event for the filterbar input element
args.element.bind("keyup", ej.proxy(args.column.filterBarTemplate.read, this, args));
}
function read(args) {
//Filter the column with contains operator
this.filterColumn(args.column.field, "contains", args.element.val(), "and", true);
}
</script> |
We have created a sample that can be downloaded from the below link,
Regards,
Saravanan A.