aoColumns is not working

aoColumns is not working

srimanta12srimanta12 Posts: 12Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
Instead of passing the value like [code]{'bSortable': false},null,null,null,null,null,null,null,null,null,null,null,null,null,{'bSortable': false} [/code] in aoColumns can I pass a string which is also containing the same value as above.
My Code is like:
[code]
var excluded_clmns_sorting = $('#sorting_val').val();
//the above variable returns {'bSortable': false},null,null,null,null,null,null,null,null,null,null,null,null,null,{'bSortable': false}.
var oTable = $('#data-table').dataTable( {
"sDom": 'CT<"clear">firtlip',
"oTableTools": {
"sSwfPath": basePath+"/js/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [ {"sExtends": "csv","sFileName" : curpath+".csv","sButtonText": "Save to CSV","mColumns": "visible"} ]
},
"aoColumns" : [excluded_clmns_sorting]
} );
[/code]
In js Console it is showing nCell is undefined.
if I pass array in excluded_clmns_sorting variable and doing the following code:
[code]
var excluded_clmns_sorting = $('#sorting_val').val();
var excluded_clmn_sorting = (excluded_clmns_sorting) ? excluded_clmns_sorting.split(",") : [];
$.each(excluded_clmn_sorting, function (i) {
excluded_clmn_sorting[i] = (excluded_clmn_sorting[i]);
})

var oTable = $('#data-table').dataTable( {
"sDom": 'CT<"clear">firtlip',
"oTableTools": {
"sSwfPath": basePath+"/js/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [ {"sExtends": "csv","sFileName" : curpath+".csv","sButtonText": "Save to CSV","mColumns": "visible"} ]

},
"aoColumns" : [excluded_clmn_sorting],
"aoColumnDefs": [{
"bVisible": false,
"aTargets" : excluded_clmn
},
],
"iDisplayLength": 10,
'sPaginationType': 'full_numbers'
} );
[/code]
Then in js Console it is showing only oCol is undefined.

Please guide me how to resolve this issue.
This discussion has been closed.