Modifying aoColumns using client side script

Modifying aoColumns using client side script

vishalvishal Posts: 2Questions: 0Answers: 0
edited December 2010 in General
First of all, Data Tables is amazing. Specially for someone like me who knows bare minimum javascript.

From what I understand datatables does not allow columns to be defined dynamically. I'm desperately looking for a work around. I cannot hide and show columns dynamically. That wont serve my purpose.
I believe that I can achieve define column headers dynamically, on client side, by setting the oSettings.aoColumns property. Correct?
If so, please help me understand what I'm doing wrong here;
[code]
var dataTableHeaders={"summary":[
{ "sName":"Search Summary","bSortable":false,"bSearchable":false},
{ "sName":"","bSortable":false,"bSearchable":false},
],
};

"fnServerData":function (sSource,aoData,fnCallback){
prev_url=getTableUri(); //Gets URI dynamically. This part is working fine
var oSettings=$('#dTable1').dataTable().fnSettings();
oSettings.aoColumns=[];
for(i=0;i
This discussion has been closed.