-
Notifications
You must be signed in to change notification settings - Fork 754
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
How to disable counting the row in pager plugin #348
Comments
Just remove the |
What I mean is like this: <table>
<thead>
<th>Table</h1>
<th>Table</h1>
</thead>
<tbody>
<tr class="count and display me"><td>count and display me</td><td>count and display me</td></tr>
<tr class="ignore me or do not display"><td colspan="2">ignore me or do not display</td></tr>
</tbody>
</table> |
Sorry - I misunderstood your question. You could look to not return these rows from the server or failing that override the code around here with custom numbers that you calculate, but this would be a hack. I think you are trying to shoe horn functionality that isn't compatible with the library. I.e. why would you have a row that you show but do not count. And if you don't want to show it why is it in the table? Good luck. |
this seems to be more of a custom thing, I somewhat do the same, so lets say you have a table and one of the cols has a number in it, a sum of something but you only want every sum that is over say 30. I first give that col a class say "coltocheck", then I add a class "countme" to that tr (row). Then I run a count on that, I have a script to update the counts which I won't post, but it's the same type of idea I think. This really wouldn't be part of tablesorter since it's a specific table usage IMHO but thought I'd share how I handle it.
|
@camallen - It's ok.. What I'm planning to do is to have a show/hide for that.. something like this one <table>
<thead>
<th>Data 1</th>
<th>Data 2</th>
<th>Data 3</th>
<th>Data 4</th>
<th>Data 5</th>
</thead>
<tbody>
<tr>
<td>data content</td>
<td>data content</td>
<td>data content</td>
<td>data content</td>
<td>show statistic</td>
</tr>
<tr>
<td colspan="5">Show Statistics Here</td>
</tr>
</tbody>
</table> so when you click the show statistic it will show the statistic data like that.. @TheSin- Thanks for the idea.. will work for that and see how is it working.. |
A quick thought, if you add the statistics row after creating the table then the row counts would be correct (until you re-evalutated the table) as they are computed on the table update / build events (when your row wouldn't be in the table). So for instance you could tap into the table build / update event and after each event you compute your stats and insert them as their own row in JS. Good luck! |
now that I think about it more, if it's just a stats row you want why not add it to tfoot instead? then it won't be counted. Only tbody gets counted. |
It is as @TheSin- mentioned. Just add your extra statistic row into the tfoot (see this demo). I did find a bug that will be fixed in the next update. It causes the pager to not properly hide child rows when the |
Oh I guess I misunderstood the question too... to make the pager ignore a row, just make it a child row. It does attach it to the row above it, so keep that in mind. <tr class="tablesorter-childRow">
<td colspan="5">Show Statistics Here</td>
</tr> |
is there a way to disable the count of some row in pager plugin so that it will not displaying in the pagedisplay...
The text was updated successfully, but these errors were encountered: