How can i add input fields to the datatable header?

How can i add input fields to the datatable header?

Sekhar1984Sekhar1984 Posts: 1Questions: 1Answers: 0

How can i add input fields to the datatable header?

Answers

  • btreebtree Posts: 99Questions: 14Answers: 11
    edited November 2015

    Hoi,

    something like this? Would add to each column an Input field.

    $('#datatable_id thead th').each( function () {
        var number = $(this).index().toString();
        var n = number.search(rows);
        if (number.search(rows) == 0){
            var title = $('#datatable_id thead th').eq( $(this).index() ).text();
            $(this).html( '<input type="text" placeholder="'+title+'" />' );
        };
    } );    
    

    Cheers
    Hannes

This discussion has been closed.