admin管理员组

文章数量:1404461

i'm looking to find and replace specific values from a known column with the plugin called Datatables.

Here is my code to do that :

table.columns(5).search('valuetochange').cells().every( function () {
  this.data('newvalue');
});

But it is not working, I also tried other solutions but I didn't find a way to update the cells.

Thank you for your help

i'm looking to find and replace specific values from a known column with the plugin called Datatables.

Here is my code to do that :

table.columns(5).search('valuetochange').cells().every( function () {
  this.data('newvalue');
});

But it is not working, I also tried other solutions but I didn't find a way to update the cells.

Thank you for your help

Share edited Jun 19, 2015 at 12:28 Dhiraj 33.6k10 gold badges65 silver badges78 bronze badges asked Jun 19, 2015 at 12:27 bidou88bidou88 6942 gold badges10 silver badges31 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

I have not used search method but alternatively this will definitely work

table.column(5).nodes().each(function (node, index, dt) {
  if(table.cell(node).data() == valuetochange){
    table.cell(node).data('100');
  }
});

Here is a demo JsFiddle

本文标签: javascriptFind and replace cells value with Datatables pluginStack Overflow