Unexpected initialization return value when initialising inside an Object

Unexpected initialization return value when initialising inside an Object

arvinsimarvinsim Posts: 20Questions: 1Answers: 0
edited September 2011 in General
I put the dataTable function initialization inside an object but I don't get the same result as when I initialize it outside the object

Initialization outside object

[code]var dataTable = $('datatable').dataTable();[/code]

Initialization inside object

[code]
var aObject = {
dataTable : null,
initFunction : function() {
// this.dataTable contents is not the same when I initialize dataTable outside the object
this.dataTable = $('datatable').dataTable();
}
}
[/code]

Why is this?

Replies

  • arvinsimarvinsim Posts: 20Questions: 1Answers: 0
    Nevermind. This was because the selector name for the table is wrong.
This discussion has been closed.