Hello, Kendo-Team.
I have a question about complex JSON responses: Say, I get a response like this and want to use this data for creating a Grid:
so how should I use <code>dataSource.schema</code> and/or <code>kendoGrid.columns</code> properties to get size.bytes and/or mtime.UTC ? How to correctly parse this type of DATETIME info via JS ? Templates ?
I only know, I should use <code>dataSource.schems.items</code> to point out the Array with objects (in my case it's "items")
without defining any columns, I get size and mtime columns with [object Object] in it.
I have a question about complex JSON responses: Say, I get a response like this and want to use this data for creating a Grid:
01.
{
02.
"items"
: [
03.
....
04.
....
05.
....
06.
{
07.
"fileName"
:
"Pragmatic Bookshelf - CoffeeScript.Jul.2011.ENG.pdf"
,
08.
"folderPath"
:
"I:\\eBooks"
,
09.
"absolutePath"
:
"I:\\eBooks\\Pragmatic Bookshelf - CoffeeScript.Jul.2011.ENG.pdf"
,
10.
"size"
: {
11.
"bytes"
: 3573254,
12.
"MBytes"
: 3.41
13.
},
14.
"mtime"
: {
15.
"UTC"
:
"\/Date(1315848420988)\/"
,
16.
"shortDate"
:
"12.09.2011"
17.
}
18.
},
19.
....
20.
....
21.
....
22.
],
23.
"totalItems"
: 540
24.
}
so how should I use <code>dataSource.schema</code> and/or <code>kendoGrid.columns</code> properties to get size.bytes and/or mtime.UTC ? How to correctly parse this type of DATETIME info via JS ? Templates ?
I only know, I should use <code>dataSource.schems.items</code> to point out the Array with objects (in my case it's "items")
01.
dataSource({
02.
transport: {
03.
....
04.
},
05.
schema : {
06.
data:
"items"
,
07.
total :
function
(data) {
08.
// if pagination is enabled - it won't work
09.
// without declaring this function
10.
return
data.totalItems;
11.
}
12.
}
13.
});
without defining any columns, I get size and mtime columns with [object Object] in it.