tooltip not a function issue

tooltip not a function issue

lipwig79lipwig79 Posts: 6Questions: 0Answers: 0
edited March 2011 in General
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);
});

});

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    It might be a daft question, but have you included the tooltip JS? Does it work if you give it just a node, rather than the array of nodes that fnGetNodes gives?

    To check fnGetNodes you could do alert( deviceTable.fnGetNodes().length ).

    Allan
  • lipwig79lipwig79 Posts: 6Questions: 0Answers: 0
    Urm . . . . Ooops. No it wasn't a stupid question. I had forgotten the tooltip js. I knew it was a newbie mistake. we live and learn. Thanks allan.
This discussion has been closed.