0
我有多個具有相同數據類型的列,當我嘗試對它們進行排序,一些排序並且其他一些只是恢復到默認排序列表選項。tablesorter無法對類似列進行排序
HTML:
<table id="WatchListDataTable_21631" class="tablesorter ui-scrollview-view tablesorter-default hasResizable hasStickyHeaders" role="grid" style="overflow: hidden; position: relative; left: 0px; top: 0px;">
<thead>
<tr role="row" class="tablesorter-headerRow">
<th data-sel="Close" data-column="0" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="الاغلاق: No sort applied, activate to apply an ascending sort" style="width: 68px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>الاغلاق</span> </div>
</th>
<th data-sel="Open" data-column="1" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="افتتاح: No sort applied, activate to apply an ascending sort" style="width: 56px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>افتتاح</span> </div>
</th>
<th data-sel="Low" data-column="2" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="ادنى: No sort applied, activate to apply an ascending sort" style="width: 46px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>ادنى</span> </div>
</th>
<th data-sel="High" data-column="3" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="اعلى: No sort applied, activate to apply an ascending sort" style="width: 47px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>اعلى</span> </div>
</th>
<th data-sel="Offer" data-column="4" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="العرض: No sort applied, activate to apply an ascending sort" style="width: 48px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>العرض</span> </div>
</th>
<th data-sel="OfrQty" data-column="5" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="ك العرض: No sort applied, activate to apply an ascending sort" style="width: 69px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span> ك العرض</span> </div>
</th>
<th data-sel="BidPrice" data-column="6" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="الطلب: No sort applied, activate to apply an ascending sort" style="width: 54px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>الطلب</span> </div>
</th>
<th data-sel="BidQty" data-column="7" class="tablesorter-header tablesorter-headerDesc primary" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="descending" aria-label="ك الطلب: Descending sort applied, activate to apply an ascending sort" style="width: 88px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>ك الطلب</span> </div>
</th>
<th data-sel="TradedVol" data-column="8" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="حجم الصفقات: No sort applied, activate to apply an ascending sort" style="width: 72px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>حجم الصفقات</span> </div>
</th>
<th data-sel="Traded" data-column="9" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="الصفقات: No sort applied, activate to apply an ascending sort" style="width: 69px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>الصفقات</span> </div>
</th>
<th data-sel="Time" data-column="10" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="الوقت: No sort applied, activate to apply an ascending sort" style="width: 48px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>الوقت</span> </div>
</th>
<th data-sel="Prcnt" data-column="11" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="%نسبة: No sort applied, activate to apply an ascending sort" style="width: 49px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span> %نسبة</span> </div>
</th>
<th data-sel="Change" data-column="12" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="التغيير: No sort applied, activate to apply an ascending sort" style="width: 58px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>التغيير</span> </div>
</th>
<th data-sel="LastQty" data-column="13" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="اخر كميه: No sort applied, activate to apply an ascending sort" style="width: 58px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>اخر كميه</span> </div>
</th>
<th data-sel="LastPrice" data-column="14" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="اخر سعر: No sort applied, activate to apply an ascending sort" style="width: 82px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>اخر سعر</span> </div>
</th>
<th data-sel="Company" data-column="15" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="الاسم: No sort applied, activate to apply an ascending sort" style="width: 125px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>الاسم</span> </div>
</th>
<th data-sel="Symbol" data-column="16" class="tablesorter-header tablesorter-headerUnSorted" tabindex="0" scope="col" role="columnheader" aria-disabled="false" aria-controls="WatchListDataTable_21631" unselectable="on" aria-sort="none" aria-label="السهم: No sort applied, activate to apply an ascending sort" style="width: 58px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>السهم</span> <span class="SymbolStatusIcon"></span> </div>
</th>
<th data-sel="#" class="resizable-false columnSelector-disable sorter-false cancel-drag dragtable-drag-boundary tablesorter-header tablesorter-headerUnSorted" data-column="17" scope="col" role="columnheader" aria-disabled="true" unselectable="on" aria-sort="none" aria-label="#: No sort applied, sorting is disabled" style="width: 30px;">
<div class="tablesorter-header-inner"><i class="tablesorter-icon"></i> <span>#</span> </div>
</th>
</tr>
</thead>
<tbody id="TableRowsTemplate" aria-live="polite" aria-relevant="all">
<tr id="DivID_21631_2350_Row" role="row">
<td data-sel="Close" class=""> <span id="DivID_21631_2350_Close" class="cell-data">4.59</span> </td>
<td data-sel="Open" class=""> <span id="DivID_21631_2350_Open" class="cell-data">4.90</span> </td>
<td data-sel="Low" class=""> <span id="DivID_21631_2350_Low" class="cell-data">4.55</span> </td>
<td data-sel="High" class=""> <span id="DivID_21631_2350_High" class="cell-data">4.90</span> </td>
<td data-sel="Offer" class=""> <span id="DivID_21631_2350_Offer" class="cell-data">4.60</span> </td>
<td data-sel="OfrQty" class=""> <span id="DivID_21631_2350_OfrQty" class="cell-data">91,519</span> </td>
<td data-sel="BidPrice"> <span id="DivID_21631_2350_BidPrice" class="cell-data">4.55</span> </td>
<td data-sel="BidQty" class="primary"> <span id="DivID_21631_2350_BidQty" class="cell-data">853,284</span> </td>
<td data-sel="TradedVol" class=""> <span id="DivID_21631_2350_TradedVol" class="cell-data">18,356,347</span> </td>
<td data-sel="Traded" class=""> <span id="DivID_21631_2350_Traded" class="cell-data">1,885</span> </td>
<td data-sel="Time" class=""> <span id="DivID_21631_2350_Time" class="cell-data">15:29:49</span> </td>
<td data-sel="Prcnt" class="changedowntdcssclass"> <span id="DivID_21631_2350_Prcnt" class="cell-data">-6.14%</span> </td>
<td data-sel="Change" class="changedowntdcssclass"> <span id="DivID_21631_2350_Change" class="cell-data">-0.30</span> </td>
<td data-sel="LastQty" class=""> <span id="DivID_21631_2350_LastQty" class="cell-data">18,964</span> </td>
<td data-sel="Company"> <span id="DivID_21631_2350_Company" class="cell-data">كيان</span> </td>
<td data-sel="Symbol"> <span id="DivID_21631_2350_Symbol" class="cell-data">2350</span> </td>
</tr>
<tr id="DivID_21631_4300_Row" role="row">
<td data-sel="Close" class=""> <span id="DivID_21631_4300_Close" class="cell-data">4.55</span> </td>
<td data-sel="Open" class=""> <span id="DivID_21631_4300_Open" class="cell-data">4.85</span> </td>
<td data-sel="Low" class=""> <span id="DivID_21631_4300_Low" class="cell-data">4.55</span> </td>
<td data-sel="High" class=""> <span id="DivID_21631_4300_High" class="cell-data">4.90</span> </td>
<td data-sel="Offer" class=""> <span id="DivID_21631_4300_Offer" class="cell-data">4.60</span> </td>
<td data-sel="OfrQty" class=""> <span id="DivID_21631_4300_OfrQty" class="cell-data">1,034,124</span> </td>
<td data-sel="BidPrice"> <span id="DivID_21631_4300_BidPrice" class="cell-data">4.55</span> </td>
<td data-sel="BidQty" class="primary"> <span id="DivID_21631_4300_BidQty" class="cell-data">823,252</span> </td>
<td data-sel="TradedVol" class=""> <span id="DivID_21631_4300_TradedVol" class="cell-data">35,065,138</span> </td>
<td data-sel="Traded" class=""> <span id="DivID_21631_4300_Traded" class="cell-data">3,385</span> </td>
<td data-sel="Time" class=""> <span id="DivID_21631_4300_Time" class="cell-data">15:29:54</span> </td>
<td data-sel="Prcnt" class="changedowntdcssclass"> <span id="DivID_21631_4300_Prcnt" class="cell-data">-6.95%</span> </td>
<td data-sel="Change" class="changedowntdcssclass"> <span id="DivID_21631_4300_Change" class="cell-data">-0.34</span> </td>
<td data-sel="LastQty" class=""> <span id="DivID_21631_4300_LastQty" class="cell-data">60,000</span> </td>
<td data-sel="Company"> <span id="DivID_21631_4300_Company" class="cell-data">دار الأركان</span> </td>
<td data-sel="Symbol"> <span id="DivID_21631_4300_Symbol" class="cell-data">4300</span> </td>
</tr>
<tr id="DivID_21631_7040_Row" role="row">
<td data-sel="Close" class=""> <span id="DivID_21631_7040_Close" class="cell-data">3.90</span> </td>
<td data-sel="Open" class=""> <span id="DivID_21631_7040_Open" class="cell-data">4.15</span> </td>
<td data-sel="Low" class=""> <span id="DivID_21631_7040_Low" class="cell-data">3.90</span> </td>
<td data-sel="High" class=""> <span id="DivID_21631_7040_High" class="cell-data">4.25</span> </td>
<td data-sel="Offer" class=""> <span id="DivID_21631_7040_Offer" class="cell-data">3.95</span> </td>
<td data-sel="OfrQty" class=""> <span id="DivID_21631_7040_OfrQty" class="cell-data">148,715</span> </td>
<td data-sel="BidPrice"> <span id="DivID_21631_7040_BidPrice" class="cell-data">3.90</span> </td>
<td data-sel="BidQty" class="primary"> <span id="DivID_21631_7040_BidQty" class="cell-data">363,928</span> </td>
<td data-sel="TradedVol" class=""> <span id="DivID_21631_7040_TradedVol" class="cell-data">6,269,310</span> </td>
<td data-sel="Traded" class=""> <span id="DivID_21631_7040_Traded" class="cell-data">1,037</span> </td>
<td data-sel="Time" class=""> <span id="DivID_21631_7040_Time" class="cell-data">15:29:47</span> </td>
<td data-sel="Prcnt" class="changedowntdcssclass"> <span id="DivID_21631_7040_Prcnt" class="cell-data">-5.80%</span> </td>
<td data-sel="Change" class="changedowntdcssclass"> <span id="DivID_21631_7040_Change" class="cell-data">-0.24</span> </td>
<td data-sel="LastQty" class=""> <span id="DivID_21631_7040_LastQty" class="cell-data">20,216</span> </td>
<td data-sel="Company"> <span id="DivID_21631_7040_Company" class="cell-data">عذيب للاتصالات</span> </td>
<td data-sel="Symbol"> <span id="DivID_21631_7040_Symbol" class="cell-data">7040</span> <span id="DivID_21631_7040_SymbolColor" class="SymbolStatus" style="background: Yellow;"></span> </td>
</tr>
<tr id="DivID_21631_9400_Row" role="row">
<td data-sel="Close" class=""> <span id="DivID_21631_9400_Close" class="cell-data">21.30</span> </td>
<td data-sel="Open" class=""> <span id="DivID_21631_9400_Open" class="cell-data">21.10</span> </td>
<td data-sel="Low" class=""> <span id="DivID_21631_9400_Low" class="cell-data">21.10</span> </td>
<td data-sel="High" class=""> <span id="DivID_21631_9400_High" class="cell-data">21.30</span> </td>
<td data-sel="Offer" class=""> <span id="DivID_21631_9400_Offer" class="cell-data">21.20</span> </td>
<td data-sel="OfrQty" class=""> <span id="DivID_21631_9400_OfrQty" class="cell-data">150,281</span> </td>
<td data-sel="BidPrice"> <span id="DivID_21631_9400_BidPrice" class="cell-data">21.00</span> </td>
<td data-sel="BidQty" class="primary"> <span id="DivID_21631_9400_BidQty" class="cell-data">149,881</span> </td>
<td data-sel="TradedVol" class=""> <span id="DivID_21631_9400_TradedVol" class="cell-data">239,838</span> </td>
<td data-sel="Traded" class=""> <span id="DivID_21631_9400_Traded" class="cell-data">7</span> </td>
<td data-sel="Time" class=""> <span id="DivID_21631_9400_Time" class="cell-data">14:51:10</span> </td>
<td data-sel="Prcnt" class="changedowntdcssclass"> <span id="DivID_21631_9400_Prcnt" class="cell-data">-2.29%</span> </td>
<td data-sel="Change" class="changedowntdcssclass"> <span id="DivID_21631_9400_Change" class="cell-data">-0.50</span> </td>
<td data-sel="LastQty" class=""> <span id="DivID_21631_9400_LastQty" class="cell-data">41,123</span> </td>
<td data-sel="Company"> <span id="DivID_21631_9400_Company" class="cell-data">فالكم 30</span> </td>
<td data-sel="Symbol"> <span id="DivID_21631_9400_Symbol" class="cell-data">9400</span> </td>
</tr>
<tr id="DivID_21631_4140_Row" role="row">
<td data-sel="Close" class=""> <span id="DivID_21631_4140_Close" class="cell-data">36.08</span> </td>
<td data-sel="Open" class=""> <span id="DivID_21631_4140_Open" class="cell-data">38.10</span> </td>
<td data-sel="Low" class=""> <span id="DivID_21631_4140_Low" class="cell-data">35.10</span> </td>
<td data-sel="High" class=""> <span id="DivID_21631_4140_High" class="cell-data">40.00</span> </td>
<td data-sel="Offer" class=""> <span id="DivID_21631_4140_Offer" class="cell-data">36.80</span> </td>
<td data-sel="OfrQty" class=""> <span id="DivID_21631_4140_OfrQty" class="cell-data">1,852</span> </td>
<td data-sel="BidPrice"> <span id="DivID_21631_4140_BidPrice" class="cell-data">36.60</span> </td>
<td data-sel="BidQty" class="primary"> <span id="DivID_21631_4140_BidQty" class="cell-data">102,791</span> </td>
<td data-sel="TradedVol" class=""> <span id="DivID_21631_4140_TradedVol" class="cell-data">2,766,332</span> </td>
<td data-sel="Traded" class=""> <span id="DivID_21631_4140_Traded" class="cell-data">3,818</span> </td>
<td data-sel="Time" class=""> <span id="DivID_21631_4140_Time" class="cell-data">15:29:54</span> </td>
<td data-sel="Prcnt" class="changedowntdcssclass"> <span id="DivID_21631_4140_Prcnt" class="cell-data">-6.75%</span> </td>
<td data-sel="Change" class="changedowntdcssclass"> <span id="DivID_21631_4140_Change" class="cell-data">-2.61</span> </td>
<td data-sel="LastQty" class=""> <span id="DivID_21631_4140_LastQty" class="cell-data">651</span> </td>
<td data-sel="Company"> <span id="DivID_21631_4140_Company" class="cell-data">الصادرات</span> </td>
<td data-sel="Symbol"> <span id="DivID_21631_4140_Symbol" class="cell-data">4140</span> </td>
</tr>
</tbody>
排序是僅在若干列(僅限下列 '數據-SEL' 值)工作: -
- 符號
- 公司
- BidQty
- BidPrice
因此,這或者是魔法,還是魔法......除非有一些隱藏的解釋可用!
正如你所看到的,兩個出價&供應欄具有相同的值,說實話它是一個格式化的數量或所有列的價格!
tablesorter自動列檢測已經檢測到他們所有的'數字',我試着解析與貨幣,但都一樣..它根本不分類!我瘋了,因爲它!
在此先感謝
你將不得不觸發一個「更新」,因爲它聽起來像表中的數據不斷刷新。如果您在ajax成功代碼中添加觸發器,則不需要使用500毫秒的時間間隔。如果情況並非如此,那麼請分享正在使用的JavaScript。 – Mottie