Hi
I’m wondering how to get all rows values to an array (javascript or php)
I’ve tried somethings with for each row but didin’t work really. I’m a beginner in javascript an hope you guys can help me!
Thanks!
ps: my grid has two columns and about 10 rows (rows are added by drag n drop)
tried for Tests:
for (var i=0; i<myGrid.getRowsNum(); i++)
{
alert(myGrid.cells(i,0).getValue());
}
function get_data(){
var rowArr = [];
var newArr = [];
var rows = myGrid.getRowsNum();
var columns = myGrid.getColumnCount();
for (var r=0; r<rows; r++){ //iterate through the rows
for (var c=0; c<columns; c++){ //iterate through the columns
newVal = myGrid.cellByIndex(r,c).getValue(); //get the value of the current cell
rowArr.push(newVal) // push it to the array with the "row" data
}
newArr.push(rowArr) //save save the row data as an element of the array with the data
rowArr = []; // reset the row data array
};
console.log(newArr)
}
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan