2016-11-24 41 views
1

電子郵件行是父級。地址是子行。
爲每個搜索過濾器關鍵字顯示childRows。
我的目標是簡單地過濾childRows,並只顯示與父行相匹配的childRows作爲輸出。
有人可以幫助我找出問題所在。Tablesorter Child Row總是爲每個搜索過濾器顯示

enter image description here

HTML代碼:

<div class="form-control divCheckBox"> 
     <div class="tableFilterLink" data-table="selectedTableFilter"> 
      <i class="icon-filter"></i> 
      <a>Show Filters</a> 
     </div> 
     <table id="selectedTableFilter" class="table table-bordered table-striped"> 
      <thead> 
      <tr> 
       <th>Selected Email</th> 
      </tr> 
      </thead> 
      <tbody> 
      <tr> 
       <td>[email protected]</td> 
      </tr> 
      <tr> 
       <td>[email protected]</td> 
      </tr> 
      <tr class="tablesorter-childRow"> 
       <td colspan="4"> 
       <div class="bold">Shipping Address</div> 
       <div>2255 254th Avenue Se<br>Albany, Oregon 97321</div> 
       </td> 
      </tr> 
      <tr> 
       <td>[email protected]</td> 
      </tr> 
      <tr class="tablesorter-childRow"> 
       <td colspan="4"> 
       <div class="bold">Shipping Address</div> 
       <div>99700 Bell Road<br>Auburn, California 95603</div> 
       </td> 
      </tr> 
      </tbody> 
     </table> 
    </div> 

的Javascript:

$("#selectedTableFilter").tablesorter({ 
    debug: true, 
    headerTemplate: "{content}<b></b>", 
    cssChildRow : "tablesorter-childRow", 
    widgets: ["zebra","filter"], 
    sortInitialOrder: "asc", 
    sortList: [[0,0]], 
    sortRestart: true, 
    widgetOptions: { 
     filter_hideFilters: true, 
     zebra : ['normal-row', 'alt-row' ], 
     filter_childRows: true, 
     filter_cssFilter : 'tablesorter-filter', 
     filter_startsWith: false, 
     filter_ignoreCase : true, 
     filter_childWithSibs: false, 
    }, 
    widthFixed: true 
}); 
+0

所以電子郵件地址行是父母在這裏? – Searching

+0

是的。 @搜索 –

+0

Ohk ..但似乎沒有任何樣本中的結構...你如何區分新紀錄?一切都在一個新的行.. – Searching

回答

0

感謝@Mottie

Github Issue link

如果你正在使用的tablesorter自定義主題,請確保以下的定義包括:

.tablesorter-filter { 
    display: none; 
} 

JSFIDDLE