BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" create="onCreate">
<e-filter-settings filter-type="menu"></e-filter-settings>
. . .
</ej-grid>
<script type="text/javascript">
function onCreate() {
if (this.model.allowFiltering && this.model.filterSettings.filterType == "menu") {
$("#" + this._id + "_" + "stringDlg").ejDialog({
//bind the open event for the string filter dialog
open: function (args) {
var drpobj = this.element.find(".e-dropdownlist").ejDropDownList("instance");
//changed as Contains rather than startsWith
drpobj.selectItemByValue("Contains");
}
})
}
}
</script> |
<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> |