using javascript arrays for aaData
using javascript arrays for aaData
pedalshoe
Posts: 9Questions: 0Answers: 0
Hi,
i have a 2d javascript array defined as:
var myData = new Array(1)
myData [0] = new Array();
and I insert data into the array:
var i=0;
myData[0][i++] = "myData1";
myData[0][i++] ="myData2";
...
when i initialize my single column dataTable using:
"aaData":myData,..
the data table only shows one row of data. (the first record only)
Is there something I'm doing wrong here?
Thank you,
Christopher
i have a 2d javascript array defined as:
var myData = new Array(1)
myData [0] = new Array();
and I insert data into the array:
var i=0;
myData[0][i++] = "myData1";
myData[0][i++] ="myData2";
...
when i initialize my single column dataTable using:
"aaData":myData,..
the data table only shows one row of data. (the first record only)
Is there something I'm doing wrong here?
Thank you,
Christopher
This discussion has been closed.
Replies
http://www.datatables.net/release-datatables/extras/Scroller/large_js_source.html
Instead of trying to make a 2d array, i just inserted the new row by using push(["myDataN"]);
using the square brackets to specify an array (although it is only one element).
-Christopher
Here's my sample code too, just for anyone else in the future:
// Processing JSON data into an array
for (i=0; i
Allan