Getting error: TypeError: Result of expression 'otable' [undefined] is not an object.
Getting error: TypeError: Result of expression 'otable' [undefined] is not an object.
vijay_makam
Posts: 4Questions: 0Answers: 0
I am using datatable version 1.9. in phone gap container. I am getting this error.
Error "TypeError: Result of expression 'otable' [undefined] is not an object"
Below is the code. The error is not there when I remove the
otable.$('tr').click( function () {
var rowData = otable.fnGetData( this );
alert( 'The row\'s first cell clicked on had the value of '+rowData[0] );
} );
from the script below. Not able to figure what is the issue.
var otable;
function decorateTable(){
otable = $('#demo').dataTable( {
"sScrollY": "300px",
"bPaginate": true,
"bFilter": false
} );
}
//adding this click function on otable is causing the error
otable.$('tr').click( function () {
var rowData = otable.fnGetData( this );
alert( 'The row\'s first cell clicked on had the value of '+rowData[0] );
} );
$(document).on('pageinit','[data-role=page]',function(){
alert("loaded");
decorateTable();
} );
Any pointers highly appreciated.
Error "TypeError: Result of expression 'otable' [undefined] is not an object"
Below is the code. The error is not there when I remove the
otable.$('tr').click( function () {
var rowData = otable.fnGetData( this );
alert( 'The row\'s first cell clicked on had the value of '+rowData[0] );
} );
from the script below. Not able to figure what is the issue.
var otable;
function decorateTable(){
otable = $('#demo').dataTable( {
"sScrollY": "300px",
"bPaginate": true,
"bFilter": false
} );
}
//adding this click function on otable is causing the error
otable.$('tr').click( function () {
var rowData = otable.fnGetData( this );
alert( 'The row\'s first cell clicked on had the value of '+rowData[0] );
} );
$(document).on('pageinit','[data-role=page]',function(){
alert("loaded");
decorateTable();
} );
Any pointers highly appreciated.
This discussion has been closed.
Replies
See: http://datatables.net/forums/discussion/9719/how-to-ask-for-help and please give us a link to a test page showing the error.
Allan