Witam,
mam problem z określeniem jakie wiersze w tabeli są w jakiej grupie, poniżej moja tabela html.
Tabela jest nie zmienna i nie mam na nią żadnego wpływu, jest ona dostarczana z zewnątrz i nie można jej modyfikować w kodzie.
<table id="navi01" cellspacing="0" cellpadding="1" border="1"> <th class="navi-axis" align="left"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <th class="navi-axis" align="left"> <img width="9" height="9" src="/FM4/jpivot/navi/column.png"> Columns
<td class="xform-close-button" align="right"> <input width="16" type="image" height="16" src="/FM4/wcf/form/cancel.png" value="Cancel" name="navi01.hiernav.cancel"> <div style="margin-left: 1em"> <a href="?null=null&wcf77b9abef=x">Measures
</a> <th class="navi-axis" align="left"> <img width="9" height="9" src="/FM4/jpivot/navi/row.png"> Rows
<div style="margin-left: 1em"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/column.png" name="wcf6551984d"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/filter.png" name="wcf31347df1"> <img width="9" height="9" src="/FM4/wcf/changeorder/move-empty.png"> <input width="9" type="image" border="0" height="9" name="wcf5fe5e865" src="/FM4/wcf/changeorder/move-down.png"> <a href="?null=null&wcf2bd22a45=x">Time
</a> <div style="margin-left: 1em"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/column.png" name="wcf2b2fd4e5"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/filter.png" name="wcf66f5a9ac"> <input width="9" type="image" border="0" height="9" name="wcfad6a94fe" src="/FM4/wcf/changeorder/move-up.png"> <input width="9" type="image" border="0" height="9" name="wcf7d426b9b" src="/FM4/wcf/changeorder/move-down.png"> <a href="?null=null&wcfead25f4c=x">FirmD
</a> <div style="margin-left: 1em"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/column.png" name="wcf72cacb99"> <input width="9" type="image" border="0" height="9" src="/FM4/jpivot/navi/filter.png" name="wcfb49befde"> <input width="9" type="image" border="0" height="9" name="wcf8a631036" src="/FM4/wcf/changeorder/move-up.png"> <img width="9" height="9" src="/FM4/wcf/changeorder/move-empty.png"> <a href="?null=null&wcf9bef1ead=x">SD
</a> <th class="navi-axis" align="left"> <img width="9" height="9" src="/FM4/jpivot/navi/filter.png"> Filter
<input type="submit" value="OK" name="navi01.hiernav.ok"> <input type="submit" value="Cancel" name="navi01.hiernav.cancel">
to mój kod js (jquery), dzięki niemu otrzymuję same wartości (nazwy kolumn i wierszy) tak jak chcę. Problem polega na tym że nie wiem które z tych wartości należą do "Columns" a które do "Rows"
$('#navi01 tbody tr td div').children('a').each(function(){
$('.dane').text($('.dane').text() +' ' + ($(this).text())); // wpisywanie pobranych wartości do diva (dla testu)
alert(jQuery(this).text());
});
wyglądowo tabelka przedstawia się mniej więcej tak:
COLUMNS
- Measures
ROWS
- Time
- FirmD
- Sd
FILTER
teraz potrzebuuję się dowiedzieć że "Measures" jest w grupie "Columns" a "time" w "Rows". Nie wiem jak to zrobić, jakoś to zliczać czy inny sposób?
utrudnieniem może być to że grupy mogą się zmieniać tzn. Measures może zostać przeniesione do Rows lub coś z Rows może zostać przeniesione do Filter bądź Columns.
Proszę o pomoc w jaki sposób mogę sprawdzać co do czego "należy".