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

Grid Date Column Default Value

1 Answer 1541 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott Rakestraw
Top achievements
Rank 1
Scott Rakestraw asked on 29 May 2013, 02:19 PM
When I add a new row my date column is getting a default value assigned to it which is the date from when the grid initially loaded and not the current date.  Is this the expected behavior?

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 31 May 2013, 12:47 PM
Hi Scott,

You are correct - this is the default behavior of Kendo UI Grid. In case you would like to change the default date you could use the dataSource.schema.model (link). As an example: 
$("#grid").kendoGrid({
  //....
  dataSource: {
     //....
     schema: {
         model: {
            fields: {
                //....
                OrderDate: { type: "date", defaultValue:  new Date("2011/12/28") },
            }
         }
     }
  }
  //....
});


Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Scott Rakestraw
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or