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

pushUpdate data including a date field

1 Answer 98 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 23 Jun 2015, 04:58 PM

Hi

 

I am facing a problem when I try to update the grid after some change has been performed on the data row and processed by the server.

The server returns the exact same model as it provides during the read method, but when I try to set that object using the pushUpdate method, date columns are displayed incorrectly. These values are not parsed in the client and end up being displayed as "/Date(1435096336667)/".

I have verified that the schema correctly defines "type": "date" for the field.

Is there any additional logic that must be performed before calling pushUpdate on the grid dataSource or should it handle a date sent as "\/Date(1435096336667)\/"?

 

Thanks, Rafael

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Jun 2015, 06:09 AM
Hi Rafael,

Yes, you should parse the string field to convert it to a date when calling pushUpdate. Here is some sample code:

dataItem.date = kendo.parseDate(dataItem.date);

dataSource.pushUpdate(dataItem);

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Rafael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or