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

How to use datePicker in Column Filter ?

$
0
0

I want to use dataPicker for only one column in Column Filter since one column has dates in it.

tried this.,

<script>
$( function() {
 $( "#example1 tfoot th:nth-child(0)".datepicker();
} );    
</script>
 
<script>
    $(document).ready(function() {
    // Setup - add a text input to each footer cell
    $('#example1 tfoot th').each( function () {
        var title = $(this).text();
        $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
    } );
  
    // DataTable
    var table = $('#example1').DataTable();
  
    // Apply the search
    table.columns().every( function () {
        var that = this;
  
        $( 'input', this.footer() ).on( 'keyup change clear', function () {
            if ( that.search() !== this.value ) {
                that
                    .search( this.value )
                    .draw();
            }
        } );
    } );
} );
 </script>

but nothing worked. Screenshot added for reference too.


Viewing all articles
Browse latest Browse all 82668

Trending Articles