Excel-like filtering DateTime
I have Grid with excel-like filter.
One of the column is DateTime type.
It is configured as following:
{ field: "CreateDate", format: "{0:yyyy/MM/dd HH:mm:ss}", type: "datetime", width: 140 },
I have 2 issues. Both of them related to datetime filter.
My questions are one the attached screenshots below
1.
2.
Thanks for contacting Syncfusion support.
Query1: How can I set time here it is always reset to 00:00:00
We fixed the issue in the latest version (14.1.0.41) and suggest you to upgrade to the latest version from the following link.
http://www.syncfusion.com/forums/123633/essential-studio-2016-volume-1-release-v14-1-0-41-is-available-for-download
Query2: How can I remove this from excel- like filter
We have achieved your requirement using actionComplete event. This event triggers for every complete actions in Grid and we used JQuery hide method to remove the excel filter search container for all the columns in Grid. Please refer to the following code example, Help document and sample.
|
<script type="text/javascript"> $(function () { $("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: window.gridData, allowPaging: true, allowFiltering: true, enableHeaderHover: true, actionComplete:"actioncomplete", 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:"OrderDate",headerText:"OrderDate", format: "{0:yyyy/MM/dd HH:mm:ss}", type: "datetime", width: 140}, { field: "ShipCity", headerText: "Ship City", width: 90 }, { field: "Verified", headerText: "Verified", width: 90 } ] }); $("#filtermenu").ejDropDownList({ "change": "selectChange", width: "120px", selectedItemIndex: 0 }) $("#sampleProperties").ejPropertiesPanel(); }); function selectChange(args) { $("#Grid").ejGrid("option", { "filterSettings": { "filterType": this.getSelectedValue() } }); } function actioncomplete(args){ if(args.requestType=="filterafteropen") this.element.find(".e-searchcontainer:visible").hide(); } |
Help document: http://help.syncfusion.com/js/api/ejgrid#events:actioncomplete
Sample: http://jsplayground.syncfusion.com/xxyx0zhv
Regards,
Jayaprakash K.
Query 1 does not work
Up!
Any updates on this issue?
- 5 Replies
- 2 Participants
-
PK Pawel Klimczyk
- Apr 21, 2016 02:18 PM UTC
- Apr 25, 2016 12:10 PM UTC