Grid - DateTime Filter not displaying entries

Hi Syncfusion-Team,


in my grid I want to filter a column which type is dateTime. Whenever I filter a specific datetime with for example the operator greaterthanorequal the request is correct and I get the expected values from my api. The problem is that the grid is not displaying any of the data.

Below you can find the grid and values without the filter and after that you can find the grid and values with a filter.


Without filtering:

 




With filtering:



As you can see the entry values from the api are exactly the same but the grid just does not display those. It only acts like this when I am using the dateTime format. 

Do you have an Idea why this is happening?


Kind Regards, Peter


3 Replies

JC Joseph Christ Nithin Issack Syncfusion Team June 3, 2022 05:39 PM UTC

Hi Peter,


  Greetings from Syncfusion support.


  Before proceeding to the solution we would like you to share the following details so that we would be able to provide a better solution ASAP.


  • Share the details of the DataManager adaptors you are using in your application.
  • Please share the code part about how you are binding the remote data to the Grid, if you are using any own logic, please share the code part.
  • Share your complete Grid rendering code.


Please get back to us for further details.


Regards,

Joseph I.



PL Peter Linecker June 7, 2022 08:40 AM UTC

Hi Syncfusion-Team,


Share the details of the DataManager adaptors you are using in your application.
We do not use the DataManager adaptors.


Please share the code part about how you are binding the remote data to the Grid, if you are using any own logic, please share the code part.

  <ejs-grid
    #grid
    [dataSource]="data"
    [allowPaging]="false"
    [allowSorting]="allowSorting"
    [allowFiltering]="allowFiltering"
    [allowGrouping]="allowGrouping"
    [allowRowDragAndDrop]="dragAndDrop"
<!-- ... -->
  >
  </ejs-grid>



As you can see we bind the data via the dataSource property. The data is json as you can see in my first post. 

I also attached the corresponding files for further reference. We are wrapping the ejs-grid in a shared component and are using the grid-service for data binding and event handling.

Kind Regards,

Peter


Attachment: grid_de7a89e1.zip


JC Joseph Christ Nithin Issack Syncfusion Team June 8, 2022 02:38 PM UTC

Hi Peter,


  Thanks for your update.


  By analyzing your query, we could see that you are using DateString value on date column. Before proceeding with your query, we would like to share the behavior of date typed column in Grid.


In EJ2 Grid, the Formatting, Filtering, Sorting, Grouping actions are performed with the data values as in the Grid’s dataSource. If the Date typed column has string value in the dataSource, then performing Sort, Filter, Group actions works like a string and date formatting is not applied on string value. This is the default behavior of Grid.


So, we suggest you to use dateObject in the Grid dataSource instead of using dateString to resolve the problem.


Date Formatting: https://ej2.syncfusion.com/react/documentation/grid/columns/columns/#date-formatting



Please get back to us for further details.


Regards,

Joseph I.


Loader.
Up arrow icon