[HELP] Qtip2 and Datatables SQL
[HELP] Qtip2 and Datatables SQL
polomintus
Posts: 3Questions: 0Answers: 0
Hi All
I really dont have a clue what im doing, if someone could look at my code and if its a simple fix then please could you share.
Basiclly I have Qtip2 tooltips working fine on my php website, I also have datatables retieving data from my SQL database and displaying it perfectly, however I want to get qtip2 tooltips working with datatables. I have used the search function on this site and most results display information in regards of the default tooltip.
Any Help appericated thanks
[code]
$(document).ready(function() {
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sScrollY": 400,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/ctables/php/nd.php"
} );
} );
// Create the tooltips only on document load
$(document).ready(function()
{
// Make sure to only match links to wikipedia with a rel tag
$('a[href*=mysitecensored.com/][rel]').each(function()
{
// We make use of the .each() loop to gain access to each element via the "this" keyword...
$(this).qtip(
{
content: {
// Set the text to an image HTML string with the correct src URL to the loading image you want to use
text: '',
ajax: {
url: $(this).attr('rel') // Use the rel attribute of each element for the url to load
},
title: {
text: 'My Site - ' + $(this).text(), // Give the tooltip a title using each elements text
button: true
}
},
position: {
at: 'bottom center', // Position the tooltip above the link
my: 'top center',
adjust: { screen: true } // Keep the tooltip on-screen at all times
},
show: {
event: 'click',
solo: true // Only show one tooltip at a time
},
hide: 'unfocus',
style: {
classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow',
}
})
// Make sure it doesn't follow the link when we click it
.click(function() { return false; });
});
});
[/code]
Thanks
Polomintus
I really dont have a clue what im doing, if someone could look at my code and if its a simple fix then please could you share.
Basiclly I have Qtip2 tooltips working fine on my php website, I also have datatables retieving data from my SQL database and displaying it perfectly, however I want to get qtip2 tooltips working with datatables. I have used the search function on this site and most results display information in regards of the default tooltip.
Any Help appericated thanks
[code]
$(document).ready(function() {
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sScrollY": 400,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/ctables/php/nd.php"
} );
} );
// Create the tooltips only on document load
$(document).ready(function()
{
// Make sure to only match links to wikipedia with a rel tag
$('a[href*=mysitecensored.com/][rel]').each(function()
{
// We make use of the .each() loop to gain access to each element via the "this" keyword...
$(this).qtip(
{
content: {
// Set the text to an image HTML string with the correct src URL to the loading image you want to use
text: '',
ajax: {
url: $(this).attr('rel') // Use the rel attribute of each element for the url to load
},
title: {
text: 'My Site - ' + $(this).text(), // Give the tooltip a title using each elements text
button: true
}
},
position: {
at: 'bottom center', // Position the tooltip above the link
my: 'top center',
adjust: { screen: true } // Keep the tooltip on-screen at all times
},
show: {
event: 'click',
solo: true // Only show one tooltip at a time
},
hide: 'unfocus',
style: {
classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow',
}
})
// Make sure it doesn't follow the link when we click it
.click(function() { return false; });
});
});
[/code]
Thanks
Polomintus
This discussion has been closed.