How to use tooltip with bProcessing & sAjaxSource ? cause oTable.fnGetNodes().length is 0
How to use tooltip with bProcessing & sAjaxSource ? cause oTable.fnGetNodes().length is 0
Hi, I have looked at the two examples
DataTables events (post-initialisation) example
and
DataTables events (pre-initialisation) example
But none of them, works in my case :(
I guess its case I use bProcessing & sAjaxSource , which cause my table to be loaded after some time,
So I cannot set the "title" data for the tr element the way the examples shows :/
also I cannot use the .tooltip( ... on each row... cause the rows appears after some delay...
So... how can I use the tooltip if I'm using the bProcessing & sAjaxSource in my table?
Thanks ahead,
Daniel.
DataTables events (post-initialisation) example
and
DataTables events (pre-initialisation) example
But none of them, works in my case :(
I guess its case I use bProcessing & sAjaxSource , which cause my table to be loaded after some time,
So I cannot set the "title" data for the tr element the way the examples shows :/
also I cannot use the .tooltip( ... on each row... cause the rows appears after some delay...
So... how can I use the tooltip if I'm using the bProcessing & sAjaxSource in my table?
Thanks ahead,
Daniel.
This discussion has been closed.
Replies
Allan
ignore...
Thx for the reply , but that applies only to the first page (I got pagination)
to set the title of each row I used
[code]"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
// set tr title.
var title = aData[11];
$(nRow).attr("title",title);
return nRow;
},
[/code]
and to apply the tooltip I used fnInitComplete
[code]
"fnInitComplete": function() {
// Apply the tooltips
$( oTable.fnGetNodes() ).tooltip( {
"delay": 0,
"track": true,
"fade": 250
} );
[/code]
Although alert($( oTable.fnGetNodes()).length); give me the right number of total rows in table (but there is only 10 in each page), it apply to the first page only, all the other pages got browser default ugly title
Is there a callback of each page redraw?
Cause if I use the fnDrawCallback it gives me each time the total number of the rows in the entire table and applying the .tooltip() inside fnDrawCallback will be too "heavy"
So what is the right way to apply the tooltip when working with pagination?
In other thread you said that a fnInitCallback should be used I think you meant fnInitComplete ?
I also tried the live method of jquery
but its not working well :/
[code]
"fnInitComplete": function() {
$('#widgetTableID tbody tr').live("mouseover", function(event) {
$(this).tooltip( {
"delay": 0,
"track": true,
"fade": 250
} );
});
}
[/code]
It apply the tooltip with a huge delay, and sometimes the default browser tooltip is back on working and the jquery tooltip os stops to work... its going on and off...
Any ideas?
Thanks ahead,
Daniel.
Thanks ahead,
Daniel.
See also: http://datatables.net/faqs#events
Allan
http://datatables.net/forums/comments.php?DiscussionID=712&page=1
"with fnDrawCallback() the events are always added on each draw. Actually, this can be bad... for example if you click page forward then page back, the rows on your first page will now have two events assigned to them. Forwards/back again and you'll have three events on them, etc... "
?
Allan