Here i have grid with columns, when try to add a new record giving an error and following is the code.
$('#dcmMappingGrid').kendoGrid({
dataSource: response.DCMMappings,
schema: {
type: 'json',
parse: function (data) {
$.each(data.items, function (i, val) {
val.StartDate = toDate(val.StartDate);
val.EndDate = toDate(val.EndDate);
});
}
},
pageable: false,
height: 550,
toolbar: ['create'],
columns: [
{ field: 'DCMId', title: 'DCM Id', width: '120px', format: '{0: 0}' },
{ field: 'StartDate', title: 'Start Date', width: '120px', format: '{0: dd-MMM-yyyy}', template: '# if( false ) { #<span>#: kendo.toString(new Date(), "dd-MMM-yyyy")#<span># } else {#<span>#: kendo.toString(toDate(StartDate), "dd-MMM-yyyy")#<span>#} #', editor: startDateEditor },
{ field: 'EndDate', title: 'End Date', width: '120px', format: '{0: dd-MMM-yyyy}', template: '#= kendo.toString(toDate(EndDate), "dd-MMM-yyyy") #', editor: endDateEditor },
{ command: ['edit', 'destroy'], title: ' ', width: '250px' }],
editable: 'inline',
edit: function (e) {
//if (!e.model.isNew()) {
//}
},
detailTemplate: kendo.template($('#template').html()),
detailInit: detailInit
});
Please help to fix this.
advance thanks.