grid.filterColumn( [
{ field: 'role', operator: 'equal', value: 'actor', predicate: 'or', matchcase: true},
{ field: 'role', operator: 'equal', value: 'actress', predicate: 'or', matchcase: true}
] );
<div id="Grid"></div>
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
dataSource: window.gridData,
allowPaging: true,
allowFiltering: true,
enableHeaderHover: true,
filterSettings: {
filterType: "excel", filteredColumns: [{ field: "CustomerID", operator: "equal", value: "VINET", predicate: "or", matchCase: true },
{ field: "CustomerID", operator: "equal", value: "TOMSP", predicate: "or", matchCase: true }]
},
columns: [
{ field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 75 },
{ field: "CustomerID", headerText: "Customer ID", width: 120 },
. . .
]
});
});
</script> |
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
allowFiltering: true,
enableHeaderHover: true,
dataBound: function(args){
this.model.filterSettings.filteredColumns = [
{ field: "CustomerID", operator: "equal", value: "VINET", predicate: "or", matchCase: true },
{ field: "CustomerID", operator: "equal", value: "TOMSP", predicate: "or", matchCase: true }
]
this.refreshContent();
},
filterSettings: { filterType:"excel"},
columns: [
{ field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 75 },
{ field: "CustomerID", headerText: "Customer ID", width: 120 },
{ field: "EmployeeID", headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 130 },
{ field: "Freight", headerText: "Freight", textAlign: ej.TextAlign.Right,format: "{0:C2}", width: 80 },
{ field: "ShipCity", headerText: "Ship City", width: 90 },
{ field: "Verified", headerText: "Verified", width: 90 }
]
});
|