jQuery functions only work on 1st pagination
jQuery functions only work on 1st pagination
Hi,
I'm running some jQuery markup on a table and it works great on page one of a paginated table but does not work on any of the later pages.
Here is what I currently have going:
[code]
$(document).ready(function() {
$.getJSON( 'jason', null, function(json) {
$('#quote_pipeline').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaData": json.aaData,
"aoColumns":
json.aoColumns
});
$('tr td:nth-child(2)').wrapInner(function() {
return ''; });
});
});
[/code]
Any help would be appreciated.
thank you.
I'm running some jQuery markup on a table and it works great on page one of a paginated table but does not work on any of the later pages.
Here is what I currently have going:
[code]
$(document).ready(function() {
$.getJSON( 'jason', null, function(json) {
$('#quote_pipeline').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaData": json.aaData,
"aoColumns":
json.aoColumns
});
$('tr td:nth-child(2)').wrapInner(function() {
return ''; });
});
});
[/code]
Any help would be appreciated.
thank you.
This discussion has been closed.
Replies
Allan
Thanks for your reply; I'm still struggling with this and have tried to set it up like the 'pre-initialization' example. Anyone see why this isn't working?
[code]
$(document).ready(function() {
//Find the index position of the column header title
//Put the index in a variable called "position"
var i = $('thead th:contains(CRM Account)').next().index();
//Find every cell with the column index matching "position"
//Iterate (.each) over the table and add markup to those cells
$('#quote_pipeline tbody tr td:nth-child(' + i + ')').each(function()
{
$(this).wrapInner(function() {
return ''
})
});
$.getJSON('jason', null,
function(json) {
$('#quote_pipeline').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaData": json.aaData,
"aoColumns":
json.aoColumns
});
});
});
[/code]
thank you,
orange
[code]
$(document).ready(function() {
$.getJSON('jason', null,
function(json) {
oTable = $('#quote_pipeline').dataTable({
"aaData": json.aaData,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": json.aoColumns
});
var myNodes = $(oTable.fnGetNodes());
myNodes.each(function() {
var i = $('thead th:contains(CRM Account)').next().index();
$('tbody tr td:nth-child(' + i + ')').each(function()
{
$(this).wrapInner(function() {
return '';
});
});
});
});
});
[/code]
script timing out.
thank you,
orange