Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.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
更新datatable jquery中的整个列_Jquery_Datatables_Jeditable - Fatal编程技术网

更新datatable jquery中的整个列

更新datatable jquery中的整个列,jquery,datatables,jeditable,Jquery,Datatables,Jeditable,我正在使用jQueryDataTable插件,我想在点击按钮时更新整个列的值。我该怎么做呢 我尝试使用FNDUpdate,但这里我们需要指定行和列 这是我的html表代码 <table id="regions" class="display" cellspacing="0" width="50%"> <thead> <tr> <th>Region</th> <th>

我正在使用jQueryDataTable插件,我想在点击按钮时更新整个列的值。我该怎么做呢

我尝试使用FNDUpdate,但这里我们需要指定行和列

这是我的html表代码

<table id="regions" class="display" cellspacing="0" width="50%">
  <thead>
      <tr>
          <th>Region</th>  
          <th>Min Score</th>  // Want min max col editable
          <th>Max Score</th> //min < max                          
      </tr>                         
  </thead>

  <tbody>   
    <% for scores_row in scores_regions %>                                                   
    <tr>
            <td><%= label_tag 'regions[]',scores_row.at(0) %></td>  
            <td>1</td>
            <td>1000</td>
   </tr>

   <% end %>
  </tbody>      
</table>

谢谢

你可以这样做

myTable.column(2).nodes().each(function(node, index, dt){
  myTable.cell(node).data('40');
});
  • column(2).nodes()将获取特定列的节点列表
  • 如果节点是DOM元素,那么cell(node)将获得一个特定的单元格

这是一个演示

请展示您迄今为止所做的尝试。有一种方法可以使DataTables插件增强的表可编辑。还有,但不是免费的。我根据你的建议进行了修改。谢谢为什么不在循环中使用
fnUpdate()
?这种方法的问题是,对于一个巨大的表,循环需要1分钟以上的时间来更改所有值
myTable.column(2).nodes().each(function(node, index, dt){
  myTable.cell(node).data('40');
});