Search code examples
javascriptjqueryteleriktelerik-gridtelerik-mvc

datetimePicker Column in $("#grid").kendoGrid


I have this column in kendo grid

{    field: "Fecha",
      title: "Fecha Aviso",
      width: 100,
      attributes: { style: "text-align:center;" },
      template: "#= Fecha != null ? kendo.toString(Fecha, 'd/MM/yyyy') : '' #"
}

And this is the model field

    fields: {
    Fecha:  { type: "date", format: "{0:dd/MM/yyyy}" }, 
...

Now the batchEdit shows only the datePicker. How can I input dateTimePicker?


Solution

  • Here is a dojo that shows it working for you: custom datetime picker in batch editing

    all I have done is define the editor for the column called Date

    editor: function (container, options) {
        var input = $("<input/>");
        input.attr("name", options.field);
    
        input.appendTo(container);
    
        input.kendoDateTimePicker({});
    }
    

    All this does is override the default editor template and applies the datetime picker control for you.

    I used this Grid API: Column Editor as a point of reference to produce this simple demo.

    If you need further info let me know and I will add to the answer if I can.