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

Nullable Date column in grid

1 Answer 876 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yuriy
Top achievements
Rank 1
Yuriy asked on 07 May 2012, 12:11 AM
Hi,

Can you please provide the way to correct edit date type column in grid
I have following parts
 defined model
var Model = kendo.data.Model.define({
                id: "Id",
                fields: {
                    SDate: { nullable: true, type: "date" } }});
and define column in grid

{
                field: "SDate",
                title: "Date",
                type: "date",
                template: "#= (SDate== null) ? ' ' : kendo.toString(toDate(SDate), 'MM/dd/yyyy') #"
            }
When records come from json result template for this column shows date correctly but once I click into cell to edit date picker has \Date(123123123123) value as input. It seems like datepicker doesn't parse json date format to edit.
Any ideas on this?

1 Answer, 1 is accepted

Sort by
0
Phillip
Top achievements
Rank 2
answered on 11 May 2012, 04:07 PM
This is a good example of how you would do this for a string type field.

{ field: "ImprintName", title: "Imprint", width: 150, template: "#=(ImprintName=='null')?'':ImprintName#" }
Tags
Grid
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Phillip
Top achievements
Rank 2
Share this question
or