I have a DataTable named 'search_table' in my page. I have a additional header row in the table that has different filter options (dropdown, text, date_pickers). For the date columns, I have two datepickers, one for min and one for max. I can filter the data for the datatable based on the datepickers, but there is one problem:
When I select a date, all the rows in my table disappear, I have to click on one of the headers (like to sort the data) to get the data to appear. Once I do so, the correct data shows (the dates are between min and max).
What functionality do I use to force the datapicker to re-draw the table? In my ready function, I have the following code:
$(document).ready(function() {
var table = $('#search_table').DataTable();
$(.datepicker).datepicker( {
maxDate:0,
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
onClose: function(selectedDate) {
table.draw();}});
$('#min_create, #max_create, #min_update, #max_update').keyup(function() { table.draw(); });
$('#min_create, #max_create, #min_update, #max_update').click( function() { table.draw(); });
$('#min_create').datepicker().bind('onClose', function(){ table.draw(); });
});
min_create, max_create, min_update and max_update are all inputs that have the datepicker class. search_table is my table that is a DataTable.