Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82271

how do i filter table with date range value?

$
0
0

I am using server side processing. on button click i want to filter my table on the basis of date.
On button click i am grabbing from and two dates from input text boxes. Now i do not know to pass these two values
in oTable.columns(i).search(v).draw();

Is it possible to pass to date in Search() method?

my codes are below
var fromDate;
var fromTo;
$('#orderDate_from').datetimepicker(
{
format: 'DD/MM/YYYY'
}
);
$('#orderDate_from').on('dp.change', function (e) {
fromDate = e.date.format("MM/DD/YYYY");
})

        $('#orderDate_to').datetimepicker(
            {
                format: 'MM/DD/YYYY'
            }
        );

        $('#orderDate_to').on('dp.change', function (e) {
             toDate = e.date.format("MM/DD/YYYY");
        })

    $('.search-date-btn').on('click', function (e) {

        var i = $(this).attr('data-column');
        var fromDateValue = fromDate;
        var toDateValue = toDate;

        oTable.columns(i).search(v).draw();

    })

Viewing all articles
Browse latest Browse all 82271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>