-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colspan sorting appears to be ignoring data-sort column values #62
Comments
@nk9 That is not ideal; thanks for opening an issue. |
I've tried working around this by removing the colspans, but the <!DOCTYPE html>
<html>
<body>
<table class="table-sort table-arrows">
<thead>
<tr>
<th>Ratio</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ratio all" data-sort="72">18/25</td>
<td>72%</td>
</tr><tr>
<td class="ratio all" data-sort="60">6/10</td>
<td>60%</td>
</tr><tr>
<td class="ratio all" data-sort="47">7/15</td>
<td>47%</td>
</tr><tr>
<td class="ratio all" data-sort="10">1/10</td>
<td>10%</td>
</tr><tr>
<td class="ratio all" data-sort="05">1/20</td>
<td>5%</td>
</tr>
</tbody>
</table>
<script src="https://leewannacott.github.io/table-sort-js/table-sort.js"></script>
</body>
</html> |
@nk9 I think you are missing "data-sort" on the |
I tried out your first example adding data-sort class to the |
Oh! Indeed, I didn't realise that you had to declare a column as taking its data from the |
Sure, feel free to do that. You could check to see if the click issue is due to having two colspan |
PR: #91 Release:https://github.com/LeeWannacott/table-sort-js/releases/tag/1.15.2 @nk9 |
Now the #58 has landed,
colspan
is working in that clicks on subsequent<th>
elements aren't sorting the wrong column. However, it looks like thecolspan
columns are ignoring thedata-sort
attribute of a given column.Expected
A click on the
colspan
element to sort first by thedata-sort
attribute of the first column inside thecolspan
, and then by the value of the cells in that same column if a cell doesn't have thedata-sort
attribute.What's happening today
It looks like the table is ignoring the
data-sort
attribute and just always sorting by the value.Reproducible case
The text was updated successfully, but these errors were encountered: