We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

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.




5 Replies

JK Jayaprakash Kamaraj Syncfusion Team April 22, 2016 09:19 AM UTC

Hi Pawel,

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();             

              }
    </script>


Help document: http://help.syncfusion.com/js/api/ejgrid#events:actioncomplete

Sample: http://jsplayground.syncfusion.com/xxyx0zhv

Regards,

Jayaprakash K.


PK Pawel Klimczyk April 22, 2016 09:22 AM UTC

Thank you Jayaprakash. I will give a try today :)


PK Pawel Klimczyk April 22, 2016 01:50 PM UTC

Query 1 does not work



PK Pawel Klimczyk replied to Pawel Klimczyk April 25, 2016 11:03 AM UTC

Query 1 does not work


Up!
Any updates on this issue?


JK Jayaprakash Kamaraj Syncfusion Team April 25, 2016 12:10 PM UTC

Hi Pawel, 
 
We have logged the requirement as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  
 
Regards, 
 
Jayaprakash K. 


Loader.
Live Chat Icon For mobile
Up arrow icon