44 lines
1.8 KiB
JavaScript
44 lines
1.8 KiB
JavaScript
|
|
$(document).ready(function(){
|
||
|
|
$(".rowShowHide").hide();
|
||
|
|
$(".tablesShowHide").hide();
|
||
|
|
// Listener odpowiadający za akcje po kliknięciu na przycisk "Exportuj do programu Excel"
|
||
|
|
|
||
|
|
$(".showTables").bind("click",function(){
|
||
|
|
if($(this).attr("class")=="plusStyle showTables")
|
||
|
|
{
|
||
|
|
//pobieramy następny wiersz tabeli którą chcemy pokazac po czym go wyswietlamy
|
||
|
|
var nextTBody = $(this).parent().parent().parent().next();
|
||
|
|
while($(nextTBody).attr("id")!="stopTables")
|
||
|
|
{
|
||
|
|
//sprawdzamy czy kategoria
|
||
|
|
if($(nextTBody).attr("class")=="tablesorter-infoOnly tablesShowHide")
|
||
|
|
{
|
||
|
|
$(nextTBody).show();
|
||
|
|
}
|
||
|
|
nextTBody=$(nextTBody).next();
|
||
|
|
}
|
||
|
|
$(this).html("[-]");
|
||
|
|
$(this).attr("class","plusStyle hideTables");
|
||
|
|
}else if($(this).attr("class")=="plusStyle hideTables")
|
||
|
|
{
|
||
|
|
//pobieramy następny wiersz tabeli którą chcemy schowac po czym go chowamy
|
||
|
|
var nextTBody = $(this).parent().parent().parent().next();
|
||
|
|
while($(nextTBody).attr("id")!="stopTables")
|
||
|
|
{
|
||
|
|
//tu chowamy wszystko więc nie sprawdzamy kategori
|
||
|
|
$(nextTBody).hide();
|
||
|
|
var changePlusMinus = $(nextTBody).children().children();
|
||
|
|
if($(changePlusMinus[0]).children("a").attr("class")=="hideRows")
|
||
|
|
{
|
||
|
|
$(changePlusMinus[0]).children("a").attr("class","showRows");
|
||
|
|
$(changePlusMinus[0]).children("a").html("[+]");
|
||
|
|
}
|
||
|
|
nextTBody=$(nextTBody).next();
|
||
|
|
}
|
||
|
|
$(this).html("[+]");
|
||
|
|
$(this).attr("class","plusStyle showTables");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|