Good day.
We have a commenting system in our site and we're using a kendo template to display the comments. As the title stated, one comment that being returned from the database has those quotes and its preventing the whole template to be loaded, once we changed the quotes into the regular ones ( " and ' ), it loaded properly.
I thought it's weird that it will not be handled. Any ideas or suggestions?
var ds = new kendo.data.DataSource({
transport: {
read: {
url: "/path/to/our/remote/function",
type: "get",
dataType: "json",
cache: false,
data: {
ID: id
}
}
},
schema : {
type: "json",
data: "Comments",
model: {
fields: {
Text: { field: "Text", type: "string" } //need this for comments consisting of only a number
}
},
parse: function (data) {
//additional processing
var comments = data.Comments;
$.map(comments, function (item, index) {
if (typeof(item.Created) !== "undefined" && item.Created != null) {
var current_datetime = moment();
var created = moment(new Date(item.Created));
item.Created = created.from(current_datetime);
}
});
return data;
}
}
});