Skip to content

Commit

Permalink
Fix the example for filtering table rows not applying visible property
Browse files Browse the repository at this point in the history
For table rows being re-rendered we need to pass a new set of rows instead
of just updating the visible property.
  • Loading branch information
Kian Esmaeilpour committed Jun 3, 2020
1 parent 2ed8673 commit 3288437
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/src/xhtml/components/table/filtering.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@
this.icon = isodd ? 'ts-icon-delete' : 'ts-icon-addfilter';
this.info = isodd ? 'Show all rows' : 'Show odd rows';
table.cols()[0].label = isodd ? 'Odd numbers' : 'All numbers';
table.rows().forEach(function(row, i) {
var newRows = table.rows().map(function (row, i) {
row.visible = isodd ? (i % 2 === 0) : true;
return row;
});
table.rows(newRows);
}
}
}
Expand Down

0 comments on commit 3288437

Please sign in to comment.