Kendo Grid Filter Date Column with format

1 Answer 5928 Views
Grid
Federico
Top achievements
Rank 1
Federico asked on 18 Jan 2019, 10:42 AM

Kendo Grid Filter Date Column with format:

Hello,

I have a kendo grid with a date column

I'd like to create a filter for this column 

The fitler would be a calendar (datepicker)

The Back-end returns this date format: "2018-11-07T00: 00: 00.000"

Then the date will be converted into the column template

-------------------------------------------------------------------------------

Column of grid:

field: 'dateA', title:'"Date"',width:175, template: kendo.template($('[id=myTemplate]').html()),format: '{0:"dd-MM-yyyy "}',filterable: {ui: 'datepicker'}},"
 
-----------------------------------------------------
<script id="myTemplate" type="text/x-kendo-template">
#if(!Utils.isNullOrUndefined(dateA)){#
#:kendo.toString(kendo.parseDate(dateA, "yyyy-MM-ddTHH:mm:ss"), "dd-MM-yyyy")#
 #}else{#
 -
#}#
</script>

 

The filter does not work.

I'd like to filter date with this format " dd-MM-yyyy" using calendar widget

How can I solve this problem?

 

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 22 Jan 2019, 07:37 AM
Hi Federico,

Based on the provided information I assume that the requirement is to change the format of the filter widget. Please correct me if I am wrong.

A possible solution is to create a custom date picker filter widget and configure it as required.

e.g.

filterable: {
  ui:function(element){
    element.kendoDatePicker({
      format:'{0: dd-MM-yyyy}'
    })
  }
}

Below you will find a small sample which demonstrates the above approach:



Regards,
Georgi
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Shoji
Top achievements
Rank 2
commented on 27 Apr 2020, 07:09 PM

How do you create a DatePicker when mode is "row"? The ui function does not seem to be called when mode i "row". Thanks.

  filterable: {
              mode: "row",I

Georgi
Telerik team
commented on 29 Apr 2020, 05:39 PM

Hi Shoji,

When in row filter mode you have to pass the handler to the column.filterable.cell.template setting.

Regards,
Georgi
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Shoji
Top achievements
Rank 2
commented on 30 Apr 2020, 12:57 PM

I got it! Thanks!
Tags
Grid
Asked by
Federico
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or