generate datatable automaticlly using the ajaxresource
generate datatable automaticlly using the ajaxresource
i get two dimensional matrix (array of arrays) from the ajaxresource,the data just like this:"aaData":[ ["1","a1","a2","a3"],
["2","b1","b2","b3"],
["3","c1","c2","c3"]
]
,but in real they may have 100 columns and 100 rows.i have seen so many examples and all of them using the parameter "aoColumns" or "aoColumnDefs" to set the column number when initialize the datatable, but i can't input the null 100 times in "aoColumns",so how can i initialize the datatable automaticlly without using the patameter "aoColumns" or "aoColumnDefs".
["2","b1","b2","b3"],
["3","c1","c2","c3"]
]
,but in real they may have 100 columns and 100 rows.i have seen so many examples and all of them using the parameter "aoColumns" or "aoColumnDefs" to set the column number when initialize the datatable, but i can't input the null 100 times in "aoColumns",so how can i initialize the datatable automaticlly without using the patameter "aoColumns" or "aoColumnDefs".
This discussion has been closed.
Replies
help me
and i get the data from ajasource without knowing the details of the data(array of arrays) like the column number,i just want to generate the datatable automaticlly with the data.In the usage of "column" i find this" Use 'null' where you wish to use only the default values and automatically detected options."but it also says " If specified, then the length of this array must be equal to the number of columns in the original HTML table" so i have a 100*100 array i have to input null in aocolumns 100 times, is there other solutions .