diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index f927323f9..b918ae7f7 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -1044,6 +1044,12 @@ function changeToEditMode() { column.visible(true); table.setColumnSearchable(column.index(), true); } + + // Re-filter/search if neccesary + var searchText = $('div.dataTables_filter input').val(); + if (!_.isEmpty(searchText)) { + table.search(searchText).draw(); + } }); }