or
function customParser(data) { if (data != null) { var str = data.toString(); if (str.indexOf("Date") >= 0) return new Date(parseInt(data.substr(6))); } else return data;<!-- datepicker editor for field: "ManufactureDate" --> <input type="text" name="ManufactureDate" data-type="date" data-bind="value:ManufactureDate" data-role="datepicker" />
//===================================================== DATA SOURCES ==============================================================|var projectDS = new kendo.data.DataSource({ transport: { create: { url: '/api/HomeApi/Add', type: 'POST', contentType: 'application/json;charset=utf-8' }, read: { url: '/api/HomeApi/Get?projectId=' + $('#UrlProjectId').val(), dataType: 'json' }, update: { url: '/api/HomeApi/Update', type: 'PUT', contentType: 'application/json;charset=utf-8', success: function (response) { // this part also not works... alert(response.IsSuccess); } }, parameterMap: function (options, operation) { if (operation !== 'read') { return JSON.stringify(options); } return options; } }, schema: { model: { id: 'Id', fields: { Id: { type: 'number', editable: false }, Title: { type: 'string', }, Description: { type: 'string' }, StartDate: { type: 'date' }, EstimatedEndDate: { type: 'date' } } } }, change: function () { projectFormVM.set('currentRecord', this.view()[0]); }, success: function (e) { // how to get this function works alert(e); }});//===================================================== VIEW MODELS ===============================================================|// Add & Update Project View Modelvar projectFormVM = kendo.observable({ currentRecord: null, projectDataSource: projectDS, projectListUrl: '/Home/Projects', hasUpdate: (($('#UrlProjectId').val() != '') ? true : false), onStartDateChange: function () { var thisStartDate = this.get('currentRecord').StartDate; if (thisStartDate) { $('#EstimatedEndDate').data('kendoDatePicker').min(thisStartDate); } }, onEndDateChange: function () { var thisEndDate = this.get('currentRecord').EstimatedEndDate; if (thisEndDate) { $('#StartDate').data('kendoDatePicker').max(thisEndDate); } }, onSave: function () { this.projectDataSource.sync(); // -- synchronize the datasource when click the save button.. }});{ field: "ShiftDefinitionId", title: "ShiftDefinitionId", format: "{0:n0}", width: "150px", editor: ShiftDefinitionIdEditor } function ShiftDefinitionIdEditor(container, options) { var inputField = $('<input data-text-field="ShiftDefinitionId" data-value-field="ShiftDefinitionId" data-bind="shiftDefinitionIdLookup: ShiftDefinitionId"/>') inputField.appendTo(container)};kendo.data.binders.shiftDefinitionIdLookup = kendo.data.Binder.extend({ init: function () { var element = this.element; }, refresh: function () { var element = this.element; }});
categoryAxis:
{
categories: ["Bulgaria", "France", "Germany", "Italy", "Spain", "UK", "US"]
}