i have kendo grid with 4 columns in it
[mac,level,timestamp,message]
.
i need to store all the values under timestamp
column in an array.I tried but couldn't find any way to traverse in a particular column. Any idea how to do this using java script?
Asked
Active
Viewed 2.0k times
4

shubham gupta
- 321
- 3
- 9
- 23
-
how about looping through all data on your grid datasource get the timestamp, and push them to an array? – himawan_r Jun 08 '15 at 14:11
2 Answers
9
Since you're using kendo which you must include jQuery. To make life easier why don't try to use jQuery, as per my suggestion at the moment i don't know any other way but to
get & loop through the grid datasource
get the date and push it into an array
For example i create button <button id="test">Click here</button>
and kendo console <div class="console"><div>
so you can see the result after clicking the button. Here goes the code :
$("#test").click(function(){
var arrayDate = [];
var data =$("#grid").data("kendoGrid").dataSource._data;
for(i=0; i<data.length; i++){
arrayDate.push(data[i].OrderDate);
}
kendoConsole.log(arrayDate);
});
Here is working example for you on kendo dojo

himawan_r
- 1,760
- 1
- 14
- 22
3
You can access your data through Grid's data source and grab it manually, something like this should work :
function getGridTimestamps() {
var grid = $("#grid").getKendoGrid(),
datas = grid.dataSource.data();
return $.map(datas, function(data) {
return data.timestamp;
});
}
var timestamps = getGridTimestamps();

Dion Dirza
- 2,575
- 2
- 17
- 21