How to set value to input type text in header table?

How to set value to input type text in header table?

btgomezbtgomez Posts: 14Questions: 6Answers: 0

I'm trying to set value to header <th></th> where the input type is text. When I removed the "scrollX": true, or changed it to "scrollX": false, in the DataTable. It works as expected when I click the row, the details will show in the th.

Below is the live sample data with "scrollX": true,
live.datatables.net/masoguma/1/

Below is the live sample data without "scrollX": true, or "scrollX": false,
live.datatables.net/riviroqi/1/

I need the scrollX because I have a more than 30 columns.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    Answer ✓

    Hi @btgomez ,

    The scrollX puts a layer above the table, so you need to refer to that

                var th = $('#tblCustomer_wrapper thead tr').find("th:eq(1)");
    
    

    See modified example here.

    Cheers,

    Colin

This discussion has been closed.