Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  107] [ 4]  / answers: 1 / hits: 20235  / 9 Years ago, mon, june 8, 2015, 12:00:00

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?


More From » kendo-ui

 Answers
75

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


[#66289] Friday, June 5, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stacie

Total Points: 476
Total Questions: 92
Total Answers: 102

Location: Bosnia and Herzegovina
Member since Tue, Mar 29, 2022
2 Years ago
stacie questions
Fri, Jun 26, 20, 00:00, 4 Years ago
Thu, Jan 23, 20, 00:00, 4 Years ago
Fri, Aug 30, 19, 00:00, 5 Years ago
Fri, Aug 2, 19, 00:00, 5 Years ago
;