How to filter on a date column with daterangepicker

How to filter on a date column with daterangepicker

diedeerdiedeer Posts: 16Questions: 2Answers: 0

Hi,

I attempt to make this function to work with just one data search field, my search field contain the start and the end values (with daterangepicker).
So I need to past the two values to the same search for the column.

This is working if I past just one value --> datatables.columns(7).search(startdate);
But what I need is sommething like : datatables.columns(7).search(startdate,enddate);
I have checked to$.fn.dataTable.ext.search.push but I don't understant how to make it workig.

Can you help me?
Best regards.

//Filter the datatable on the datepicker apply event
$('#idReportrange').on('apply.daterangepicker', function(ev, picker) 
{
    startdate=picker.startDate.format('YYYY-MM-DD');
    enddate=picker.endDate.format('YYYY-MM-DD');
    $('#idReportrange').val(startdate + ' - ' + enddate);

    alert(startdate+" "+enddate);

    datatables.columns(7).search(startdate);
    datatables.draw();

});

Replies

This discussion has been closed.