Yes works. Because of testing to another page (mistake); see now that searching like described above works by adding inputs after initialization. It's alright.
This test page has colvis and header inputs http://live.datatables.net/dikuduka/1/edit
When you show/hide a column it will keep the value in the header input. Is that possible to do with scrollx, colvis and statesave?
You need to use a similar technique. The code adds an input to the hidden column that is becoming visible. You will then need to update the input value with the current search term, such as this:
var searchVal = table.column( column ).search();
if (searchVal !== '') {
$(rowTwoTH).find('input').val(searchVal);
}
Answers
Hello Kevin,
Yes works. Because of testing to another page (mistake); see now that searching like described above works by adding inputs after initialization. It's alright.
This test page has colvis and header inputs http://live.datatables.net/dikuduka/1/edit
When you show/hide a column it will keep the value in the header input. Is that possible to do with scrollx, colvis and statesave?
Thanks,
Mark
Are you asking about keeping the input value from StateSave? If so there ae many threads regarding this such as this one:
https://datatables.net/forums/discussion/56943
Kevin
Kevin,
No. I believe they mean when the page is reloaded. I mean just keeping it in the input value. In this page http://live.datatables.net/dikuduka/1/edit there is no statesave but it will still remember the input value when you show/hide a column. In this example it doesn't: http://live.datatables.net/nodiquve/1/edit
Thanks,
Mark
You need to use a similar technique. The code adds an input to the hidden column that is becoming visible. You will then need to update the input value with the current search term, such as this:
I added this code to the first table's
$('#example').on( 'column-visibility.dt',
event handler here:http://live.datatables.net/nodiquve/4/edit
Kevin
Hello Kevin,
Yes thanks. Exactly what I was looking for.
Mark