Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 带分隔符的表格分拣机_Jquery_Ruby On Rails_Sorting_Html Table_Tablesorter - Fatal编程技术网

Jquery 带分隔符的表格分拣机

Jquery 带分隔符的表格分拣机,jquery,ruby-on-rails,sorting,html-table,tablesorter,Jquery,Ruby On Rails,Sorting,Html Table,Tablesorter,我有一个表,它有一个名为Goal的列,该表用ruby填充,如下所示: <table data-sorted="myTable"> <thead> <tr> <th><a rel="tooltip" title="Name">Name</a></th> <th>subname</th> <th>Days</th>

我有一个表,它有一个名为Goal的列,该表用ruby填充,如下所示:

<table  data-sorted="myTable">
  <thead>
    <tr>
      <th><a rel="tooltip" title="Name">Name</a></th>
      <th>subname</th>
      <th>Days</th>
      <th>%</th>
      <th>Goal</th>
      <th>achieved</th>
    </tr>
  </thead>
<tbody>
 <% @results.each do |id, rows| %>
 <% rows.each do |row| %>
    <tr>
      <td>
        <b><%= row[:name] %></b></td>
      <td><%= row[:subname] %></td>
      <td><%= row[:days] %></td>
      <td class="<%= status_indicator(row[:percentage].to_f) %>"><%= number_to_percentage(row[:percentage], :precision => 2)%></td>
      <td class="{sorter: 'thousands'}"="<%= row[:goal].to_i %>"><%=number_with_delimiter(row[:goal].to_i) %></td>
      <td class="achieved"><%= row[:achieved].to_i %></td>
    </tr>
  <% end %>
<% end %>
  </tbody>
</table>
排序在表的所有列中都起作用,但是在那些有1000个分隔符的列上,我得到了这个结果

  • 这就是加载时表格的启动方式
  • 这是排序时表格的呈现方式

  • 看起来标题选项将“千”分拣机分配到第7列(从零开始的索引)

    其中,元数据将其分配到第5列

    <td class="{sorter: 'thousands'}"...
    

    这有用吗?不太可能,问题似乎出在分隔符上,因为没有分隔符,分拣机工作正常。
    headers: {
        6: {//zero-based column index
            sorter:'thousands'
        }
    }
    
    <td class="{sorter: 'thousands'}"...
    
    headers: {
        4: {//zero-based column index
            sorter:'thousands'
        }
    }