Sort column by class name when we have colspan in a column?
Sort column by class name when we have colspan in a column?
deyvidpinzon
Posts: 2Questions: 1Answers: 0
In this case:
<thead>
<tr >
<th rowspan="2"> <spring:message code="contrato" /></th>
<th colspan="2"> <spring:message code="empresa" /></th>
<th rowspan="2"> <spring:message code="motivo" /></th>
<th class="sorted desc" rowspan="2"> DATA BLOQ. </th>
<th rowspan="2"> COLAB. BLOQ. </th>
<th rowspan="2"> DATA LIBER. </th>
<th rowspan="2"> COLAB. LIBER. </th>
</tr>
<tr>
<th> ID EMP.</th>
<th> NOME EMP.</th>
</tr>
</thead>
If I use $('th.sorted').index() it will return 3, but the correct one for the table body should be 4, because of colspan.
How can I fix this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Try:
table.column($('th.sorted')).index()
Kevin
Oh man... Thanks!
This solves my problem!