TableTools for multiple tables

TableTools for multiple tables

mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
edited January 2013 in TableTools
Hello,

I know that lot of people had the same problem than me, and some comments had been post.
But, I don't find the solution in my case.

I have multiple tables in the same page, but there are in tabs.
The tab open by default work with TableTools, but in the others tab, just print function is working.

Code JS for DataTables :
[code]
$("#contenu").tabs({
"show": function(event, ui){
var jqTable = $('table.tabStats', ui.panel);
if (jqTable.length > 0 ){
var oTableTools = TableTools.fnGetInstance(jqTable[0]);
if (oTableTools != null && oTableTools.fnResizeRequired()){
jqTable.dataTable().fnAdjustColumnSizing();
oTableTools.fnResizeButtons();
}
}
}
});

var oTableDetail = $('#tabDetail').dataTable({"sDom": '<"H"Tfr>t<"F"ip>'});
var oTableStatsUser = $('#tabStatsUser').dataTable({"sDom": '<"H"Tfr>t<"F"ip>'});
[/code]

Code JS for tabs :
[code]
$(function() {
$('#onglets').css('display', 'block');
$('#onglets').click(function(event) {
var actuel = event.target;
if (!/li/i.test(actuel.nodeName) || actuel.className.indexOf('actif') > -1) {
alert(actuel.nodeName)
return;
}
$(actuel).addClass('actif').siblings().removeClass('actif');
setDisplay();
});
function setDisplay() {
var modeAffichage;
$('#onglets li').each(function(rang) {
modeAffichage = $(this).hasClass('actif') ? '' : 'none';
if($(this).hasClass('actif')) $('.tabStats').eq(rang).removeClass('display');
else $('.tabStats').eq(rang).addClass('display');
$('.item').eq(rang).css('display', modeAffichage);
});
}
setDisplay();
});
[/code]

Code CSS for tab :
[code]
#onglets{
display: none;
}
#onglets li{
position: relative;
float: left;
list-style: none;
padding: 2px 5px 7px;
margin-right: 5px;
border: 1px solid #1175AE;
cursor: pointer;
background-color: #EEEEEE;
color: #0D5995;
z-index: 1;
}
#onglets .actif{
border-bottom: none;
font-weight: bold;
z-index: 10;
}
#contenu{
clear: both;
position: relative;
margin: 0 20px;
padding: 10px;
border: 5px solid #0D5995;
z-index: 5;
top: -6px;
background-color: #EEEEEE;
color: #0F67A1;
width: 1020px;
overflow: hidden;
border-radius: 15px;
}

.display{
display: none;
}
[/code]

Code HTML :
[code]

Détail des entrées
Statistiques globalisées
groupement par commune
Statistiques globalisées
groupement par heure du jour
Statistiques globalisées
groupement par jour de la semaine
Statistiques globalisées
groupement par mois
Statistiques globalisées
groupement par adhérents non identifiés



Détail des entrées



Usager
Date d'entrée
Heure d'entrée
Déchèterie
Commune
Statut



ALL MY DATA














Statistiques globalisées, groupement par commune



Usager
Date d'entrée
Heure d'entrée
Déchèterie
Commune
Statut



ALL MY DATA














[/code]

Thanks a lot for you help !!!

Replies

  • mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
    Up.

    Anybody can help me please ? I really don't know how do it...

    Magali
  • allanallan Posts: 61,917Questions: 1Answers: 10,151 Site admin
    Please link to a test case page so we can reproduce the issue - see: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
    No need. With download of TableTools I can do it :)

    Thank you
This discussion has been closed.