oTable is not defined *solved / edited*

oTable is not defined *solved / edited*

keirlav87keirlav87 Posts: 11Questions: 0Answers: 0
edited July 2012 in General
*edit* I have solved the problem, it was obvious really just me being stupid, i've removed the post as I made a really long post for something that was actually very simple, to summarise I was creating the tables outer html based on the result of a get request made on page load, this resulted the oTable object not being accessible outside of the get request - the solution was to create the object on page load with nothing set

like so

[code]

var oTable = $('#chasePacksDataTable').dataTable();

[/code]

and then within the get request success callback define all of the properties of the datatable like so

[code]

oTable = $('#chasePacksDataTable').dataTable( {
"bProcessing": true,
"aaData" : data.aaData,
"aoColumns": [
{ "mDataProp":"client_name" },
{ "mDataProp":"client_address_line_one" },
{ "mDataProp":"client_postcode" },
{ "mDataProp":"client_telone" },
{ "mDataProp":"added_on" },
{ "mDataProp":"affiliate_id" },
{
"mDataProp": null,
"fnRender": function(o,val) {
button = " ";
return button;
},
"sClass": "pack"
},
{
"mDataProp": null,
"fnRender": function(o,val) {
button = ' ';
return button;
},
"sClass": "pack"
}
],
});

[/code]

resulting in the object being fully defined in the global scope.

silly me!
This discussion has been closed.