JQuery combo table sorter

Sorry for the name, I did not know how to describe it better.

I have the following table:

<tr class="row-vm">
    <td>...</td>
    <td>...</td>
    ...
</tr>
<tr class="row-details">
    <td colspan="8">
        <div class="vmdetail-left">
        ...
        </div>
        <div class="vmdetail-right">
        ...
        </div>
    </td>
</tr>

Each second row contains details for the first row. By default, it is hidden using CSS, but I can open it using jQuery.

What I would like to achieve : table sorting is similar to this jQuery plugin: http://tablesorter.com/docs/ p>

Problem : The plugin must “glue” all pairs of lines and move them together. Sorting should be performed only with the data of the first row ( .row-vm), ignoring the contents of the second row ( .row-details).

Is there a jQuery plugin that supports this?

+3
5

I jQuery tablesorter , !

<tr class="row-vm">
    <td>John</td>           
</tr>
<tr class="row-details expand-child">
    <td colspan="6">
        Detail About John
    </td>
</tr>
+13

, Datatables.net, , , , ajax, , . / , .

+2

, , , , HTML- .

, "" , ?

:.

<tr>
  <div class="row-vm">
    ... info goes here- this can be in the form of floated divs,
        a ul, another table, or whatever suits you best
  </div>
  <div class="row-details">
    ... this is hidden, but can be expanded
  </div>
</tr>

, .

+1

I have the same problem, and although I have not encoded it yet, I think that if I wrote a widget that after sorting, broken through each of the visible lines, got a partner in the line and moved it to the right place in the table, which work.

0
source

Looking for this answer now in 2018, and if you are using tablesorter 2.0 mottie, there is a class in the documentation called "tablesorter-childRow". So the example above:

<tr class="row-vm">
    <td>John</td>           
</tr>
<tr class="row-details tablesorter-childRow">
    <td colspan="6">
        Detail About John
    </td>
</tr>
0
source

Source: https://habr.com/ru/post/1749012/


All Articles