0

小数値テーブルソーターグリッドのソート中に問題が発生しました。テーブル内の距離値を並べ替えようとすると、距離は次のように並べ替えられます。

distance
0.35
0.76
1.36
1.75
10.36
100.66
2.33

$(document).ready(function() {
// extend the default setting to always include the zebra widget.
$.tablesorter.defaults.widgets = ['zebra'];
// extend the default setting to always sort on the first column
$.tablesorter.defaults.sortList = [[0,0]];
$.tablesorter.defaults.debug=true;
  $("table#list").tablesorter();
  });
  $(document).ready(function() {

    $("table#list").tablesorterPager({container: $("#pager")});
    });

間違った並べ替えを防ぐための解決策を教えてもらえますか?

4

1 に答える 1

1

digitヘッダーオプションでソーターをに設定してみてください。

$(function() {
  $("table#list").tablesorter({
    widgets  : ['zebra'],
    sortList : [[0,0]]
    headers  : {
      0 : { sorter : 'digit' }
    }
  }).tablesorterPager({
    container: $("#pager")
  }); 
});
于 2012-12-03T15:48:29.667 に答える