简体   繁体   中英

Avoid Sort entire Tbody Jquery Tablesorter

I'm using Mottie Jquery tablesorter Fork.

I have this Html Structure:

  Tbody-->tr/--->th/
  tr--->Tbody
  tr
  tr
  tr


  <tr role='row'class='titulo2' id='verde".$id."'>
  <th colspan='8'><h2><i class='fas fa-balance-scale'>
  </i> Haz Seleccionado Este Juzgado y vas de primeras en el <i class='far fa-smile- 
  wink'></i></h2></th></tr><tr class='highlightgreen'><td><h5><span id ='mifav' 
  class='badge badge-Light'>sometext</span></h5></td></tr></tbody>

I'm trying to avoid to sort the entire tbody but when I do some sort the second tr inside de tbody change position like this:

在此处输入图像描述

在此处输入图像描述

Things that I've tried:

Setting no sorter classnames.

Setting specific class selector like `staticRow_class

I found the Answer into Mottie Documentation

Sorting with Multiple Tbodies

https://mottie.github.io/tablesorter/docs/example-multiple-tbodies.html

JS

$(function() {

  $("table").tablesorter({
    theme : 'blue',
    cssInfoBlock : "tablesorter-no-sort",
    widgets: [ 'zebra', 'stickyHeaders' ]
  });

});

HTML

 <tbody class="tablesorter-no-sort">
    <tr><th colspan="4">This row is within the first tbody set as an info block - it is not sorted!</th></tr>
  </tbody>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM