@{
List<object> filterColumns = new List<object>();
filterColumns.Add(new { field = "OrderDate", matchCase = false, @operator = "equal", predicate = "and", value = "4/4/1990" });
}
<ejs-grid id="GridOverview" allowFiltering="true" allowPaging="true">
<e-data-manager url="/Home/UrlDataSource" adaptor="UrlAdaptor"></e-data-manager>
<e-grid-pagesettings pageSize="4"></e-grid-pagesettings>
<e-grid-filterSettings columns="filterColumns"></e-grid-filterSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
<e-grid-column field="OrderDate" headerText=" Order Date" format="yMd" width="130"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid>
|
<ejs-grid id="GridOverview" dataSource="ViewBag.DataSource" load="load" allowFiltering="true" allowPaging="true">
<e-grid-pagesettings pageSize="4"></e-grid-pagesettings>
<e-grid-filterSettings type="Excel"></e-grid-filterSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
<e-grid-column field="OrderDate" headerText=" Order Date" type="date" format="yMd" width="130"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script>
function load(e) {
this.filterSettings.columns = [{ field : "OrderDate", matchCase : false, operator : "equal", predicate : "and", value :new Date("4/4/1990") }]
}
</script>
|