Hi,
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 dataSource.data() 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 grid.dataSource.data(newJson) 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
self._grid.dataSource.data(newJsonData);
P.S. we originally were using MVVM binding straight to the ViewModel but that didn't work either.
Thank you in advance, Jim.