This is a migrated thread and some comments may be shown as answers.

Using jQueryUI datepicker in KendoUI grid

2 Answers 2104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wanchang
Top achievements
Rank 1
Wanchang asked on 11 May 2016, 06:07 AM

I have used KendoUI grid in my web application. It runs at batch editing mode(incell edit), and there are date columns in the grid.
For some reasons, I can't using KendoUI datepicker to show the date when a cell in the column clicked. Instead,I must use the jQueryUI datepicker in edting mode.
But when the jquery date picker shown in cell, the date can not be displayed with the format which I have set.
Following is my configuration.

$("#"+currGrid.options.girdContainerId).kendoGrid({    
    dataSource: kendoGridDataSource,...    
    columns:[
      ...{ field:'StartDate',        
           editor : function(container, options){
              var $input = $("<input />").attr("name",options.field).appendTo(container);
              $input.datepicker({dateFormat:"yy/mm/dd",});
           },        
           format:"{0:yyyy/MM/dd hh:mm:ss}",},
           ...},
    ],
    editable: true

 

I set the format as "yyyy/mm/dd".But when I focus in the cell, the string "Wed Jun 17 2015 15:00:00 GMT+0900 (東京 (標準時))" will be displayed.
How can I control the value displayed in datepicker when I focus in cell ?

Best regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 12 May 2016, 03:23 PM

Hello Kiriya,

For some reason the jQuery UI DatePicker is not able to format a Date object that is passed from the model object. My suggestion is to set the value of the input to the formatted value as shown in the http://dojo.telerik.com/IZaCu example. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Wanchang
Top achievements
Rank 1
answered on 13 May 2016, 06:01 AM

Hi Boyan 

Thank you for your workaround.

 

Tags
Grid
Asked by
Wanchang
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Wanchang
Top achievements
Rank 1
Share this question
or