display all table records on multiple tables
display all table records on multiple tables
poh
Posts: 2Questions: 0Answers: 0
Hi, on my site i have tabs where I'm loading different tables, but with the same configuration. According to documentation, I'va tried to simplify the js so with this
[code]$(document).ready(function() {
$('.user-account .dataTable').dataTable();
} );[/code]
and this is my code for displaying all records on one table
[code]$('.user-account #my_table a.pagination-all').click( function () {
var oSettings = my_chips_table.fnSettings();
if($(this).hasClass('clicked')){
oSettings._iDisplayLength = 10;
}else{
oSettings._iDisplayLength = -1;
}
my_chips_table.fnDraw();
});[/code]
and this works, but when I try to replace first line with this
[code]$('.user-account .dataTable a.pagination-all').click( function () {[/code]
It doesn't work. So could You help me to make this work with multiple tables?
[code]$(document).ready(function() {
$('.user-account .dataTable').dataTable();
} );[/code]
and this is my code for displaying all records on one table
[code]$('.user-account #my_table a.pagination-all').click( function () {
var oSettings = my_chips_table.fnSettings();
if($(this).hasClass('clicked')){
oSettings._iDisplayLength = 10;
}else{
oSettings._iDisplayLength = -1;
}
my_chips_table.fnDraw();
});[/code]
and this works, but when I try to replace first line with this
[code]$('.user-account .dataTable a.pagination-all').click( function () {[/code]
It doesn't work. So could You help me to make this work with multiple tables?
This discussion has been closed.
Replies
Allan
DataTables 1.10's API will allow updating the settings of all tables in an instance directly (its in git if you are feeling brave) and has this ability built in.
Allan