Last Updated: 20 Nov 2019 11:45 by ADMIN
Created on: 08 Nov 2019 21:20
Category: Kendo UI for jQuery
Type: Bug Report
dataSource schema not applied when calling


I'm not sure this will be a bug in your mind but I just wanted to make sure I understood how things work. We have a grid definition which includes the dataSource.schema.model definition. One of the fields (TradeDate) in the schema has a type = "date". In addition, we assign local json data to the "data" property of the dataSource. Our JSON data comes in with dates in the ISO format (a string with the "T" in it). When the grid is initially created everything works fine. We notice that the TradeDate field in the is converted to an actual javascript date. I assume this is happening because of the schema definition. Later we retrieve new data via an ajax call and apply it to the grid using the command. However this does not seem to process the TradeDate field and convert it into a real javascript date. This causes problems because we have filters applied based on the TradeDate. It works fine the first time but fails any time the data is refreshed (because the field value is a string). We tried the schema.parse function but that also is only called the first time. Ultimately we coded the grids "dataBound" event and everything worked. It gets called each time the data is refreshed. I was just wondering if I could be doing something differently so that the schema handled the conversion all the time.


self._grid = grd$.kendoGrid({
columns: [...],
        dataSource: {
schema: {
                        model: {
                            id: "somekey",
                            fields: {
                                NewTradeFlag: { editable: false },
                                TradeDate: { editable: false, type: "date" },
                data: self.ViewModel.DisplayData.TransactionData

Later on we do this;

P.S. we originally were using MVVM binding straight to the ViewModel but that didn't work either.

Thank you in advance, Jim.

1 comment
Alex Hajigeorgieva
Posted on: 15 Nov 2019 15:15

Hi, James,

In the important note of the data() method we have mentioned that the schema model is not used to parse the data.

Therefore, if you want to use the method, ensure that the data is as expected - the date is a date, the number is number, etc.

Alternatively, you can use the setDataSource() method:

Let me know in case you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.