tooltip not a function issue
tooltip not a function issue
Hi all,
I'm getting an error saying that tooltip is not a function and I'm at a loss to explian why. I do though think it is a newbie error. If anyone can see my problem I'd be gratefull for any assistance.
Cheers
Chris
This is the error I get :-
TypeError: Result of expression '$(deviceTable.fnGetNodes()).tooltip' [undefined] is not a function.
This is the code:-
$(document).ready(function() {
var deviceTable = $('#example').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo":true,
"bSortClasses": false,
"bProcessing": true,
"aaData": parseTableContent(data)
});
$('#example tbody tr').each(function(){
var sTitle;
var nTds = $('td', this);
var ipAdr = $(nTds[1]).text();
var stat = $(nTds[5]).text();
if(stat =="ON")
sTitle = ipAdr+' offline duration placeholder.';
this.setAttribute('title',sTitle);
});
$(deviceTable.fnGetNodes()).tooltip( { // This is where the error is.
"delay": 0,
"track": true,
"fade": 250
} );
$("#example tbody").click(function(event){
$(deviceTable.fnSettings().aoData).each(function(){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
$('input[type=button]').click(function(){
var anSelected = fnGetSelected(deviceTable);
alert(anSelected[0].childNodes[0].innerText);
});
});
I'm getting an error saying that tooltip is not a function and I'm at a loss to explian why. I do though think it is a newbie error. If anyone can see my problem I'd be gratefull for any assistance.
Cheers
Chris
This is the error I get :-
TypeError: Result of expression '$(deviceTable.fnGetNodes()).tooltip' [undefined] is not a function.
This is the code:-
$(document).ready(function() {
var deviceTable = $('#example').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo":true,
"bSortClasses": false,
"bProcessing": true,
"aaData": parseTableContent(data)
});
$('#example tbody tr').each(function(){
var sTitle;
var nTds = $('td', this);
var ipAdr = $(nTds[1]).text();
var stat = $(nTds[5]).text();
if(stat =="ON")
sTitle = ipAdr+' offline duration placeholder.';
this.setAttribute('title',sTitle);
});
$(deviceTable.fnGetNodes()).tooltip( { // This is where the error is.
"delay": 0,
"track": true,
"fade": 250
} );
$("#example tbody").click(function(event){
$(deviceTable.fnSettings().aoData).each(function(){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
$('input[type=button]').click(function(){
var anSelected = fnGetSelected(deviceTable);
alert(anSelected[0].childNodes[0].innerText);
});
});
This discussion has been closed.
Replies
To check fnGetNodes you could do alert( deviceTable.fnGetNodes().length ).
Allan