sDefaultContent, and Requested unknown parameter

sDefaultContent, and Requested unknown parameter

AndyManAndyMan Posts: 7Questions: 1Answers: 0
edited March 2013 in DataTables 1.9
Hi,
I am running DataTables on my company IntraNet.
I have a page which handles .csv files (of various composition) and need to build my table on the fly.

I am using the:
aoColumns [ null, null, null, null, null, {"mData":null, "sDefaultContent": "Edit"}]
and
the aaData method for building my table dynamically.

When I do this everything runs fine, except that the number of nulls does not always match my needed fields.

[code]
$('#example').dataTable ({
"aoColumns": myColumns, //my list This throws the error..

// "aoColumns:[null,null,null,null,{"mData":null,"sDefaultContent":"Edit"}],
//this works but I can't anticipate the number of columns.
//plus it has the ending row value of EDIT in the table.

"aaData": fieldAttributes, //my list values..
"sScrollX": "100%",
"sScrollY": 200,
bDestroy: true,
bPaginate: true,
bFilter: true,
bAutoWidth:true,
bSort:true
});
[/code]

Is there a way to dynamically create the number of 'nulls'?

Andy

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Use aoColumnDefs rather than aoColumns . aoColumnDefs allow you to define target columns, including counting from the right (use a negative index) which it sounds like what you want. http://datatables.net/usage/columns

    Allan
This discussion has been closed.