why is this trying to create a column called '0'?

why is this trying to create a column called '0'?

barrykeepencebarrykeepence Posts: 22Questions: 0Answers: 0
edited November 2012 in General
This gives me an error when loading it:

[code]

// initialise dataTables
var oTable = $('#example').dataTable( {
"sScrollY": "410px",
"bPaginate": false,
"bProcessing": true,
"bAutoWidth": false,
"bScrollCollapse": false,
"aoColumns": [
{ "mdata": "id","bVisible": false, "bSortable": false, sTitle:"id" },
{ "mData": "n", "sDefaultContent": "Edit", sTitle : "Room Name" },
{ "mData": "b", "sDefaultContent": "Edit", sTitle : "Building" },
{ "mData": "c", "sDefaultContent": "Edit", sTitle : "Campus" },
{ "mData": "floor", "sDefaultContent": "Edit", sTitle : "Floor" },
{ "mData": "department", "sDefaultContent": "Edit", sTitle : "Department" },
{ "mData": "lab", "sDefaultContent": "Edit", sTitle : "Lab" },
{ "mData": "lecture", "sDefaultContent": "Edit", sTitle : "Lec" },
{ "mData": "tutorial", "sDefaultContent": "Edit", sTitle : "Tut" },
{ "mData": "contents", "sDefaultContent": "Edit", sTitle : "Contents"} ]
});

TRoom = new Object;
TRoom.id = 21;
TRoom.n = 'fred';
TRoom.b ='building';
TRoom.c ='campus';
TRoom.floor='fllor';
TRoom.department='dep';
TRoom.lab=1;
TRoom.lecture=2;
TRoom.tutorial=3;
TRoom.contents='cont';
$('#example').dataTable().fnAddData( TRoom );
[/code]

This gives me a warning on loading a simple object

why?

Replies

This discussion has been closed.