"Cannot read properties of undefined (reading 'getTime')"

Hi, i am using server side CRUD operations as mentioned in  Data binding in EJ2 JavaScript Schedule control | Syncfusion. I am getting the error as cannto read properties of undefined (reading gettime). I can see my data but i am sure something else is missing. Error seems to be happening in the Js below. I read the other form where they said DOM is not loaded fully.

Image_5867_1714080623097



Attachment: datasource_a57c2c6b.zip

3 Replies 1 reply marked as answer

VR Vijay Ravi Syncfusion Team April 26, 2024 02:36 PM UTC

Hi Naveen,
 

We have validated and reviewed your query. We suspect that field mapping is the issue you are facing on your end. Please refer to the below-shared documentation for your reference. Please ensure that field mapping is done properly on your end.


Field Mapping UG: https://ej2.syncfusion.com/javascript/documentation/schedule/appointments#binding-different-field-names


Please get back to us if you need any further assistance.


Regards,

Vijay




ND Naveen Davuluri April 27, 2024 03:07 PM UTC

The properties differed from .NET Core vs Javascript (when it comes to casing of letters) and also my JSON was different.


Marked as answer

VR Vijay Ravi Syncfusion Team April 29, 2024 06:44 AM UTC

Hi Naveen,


By default, Core to JavaScript camelCase is serialized, so you need to customize the property names and values. You can refer to the shared reference link below for serialization and change the JsonNamingPolicy, as shown in the code snippet shared below.


Customize propertyNames: How to customize property names and values with System.Text.Json - .NET | Microsoft Learn
 

// you need to customize the serialize options and change the JsonNamingPolicy.


var serializeOptions = new JsonSerializerOptions

{

    PropertyNamingPolicy = JsonNamingPolicy.CamelCase,

    WriteIndented = true

};

jsonString = JsonSerializer.Serialize(weatherForecast, serializeOptions);


Please get back to us if you need any further assistance.


Regards,

Vijay



Loader.
Up arrow icon