ADD DYNAMIC ROWS WITH INPUTS INSIDE DATATABLES

ADD DYNAMIC ROWS WITH INPUTS INSIDE DATATABLES

xiiiSaikixiiiSaiki Posts: 5Questions: 3Answers: 0
edited November 2016 in Free community support

hi everyone,

i'm using datatable and i wonder if there is any option to add rows with inputs dynamically i used to do it based on this link
https://datatables.net/examples/api/add_row.html
but it dosen't match with what i'm really looking for

and thank you in advance

Answers

  • wblakencwblakenc Posts: 77Questions: 17Answers: 1

    Can't you do something like:

    $('#addRow').on( 'click', function () {
            t.row.add( [
               '<input type="text" id="R_' + counter + '_1" />',
               '<input type="text" id="R_' + counter + '_2" />',
               '<input type="text" id="R_' + counter + '_3" />',
               '<input type="text" id="R_' + counter + '_4" />',
               '<input type="text" id="R_' + counter + '_5" />',
            ] ).draw( false );
     
            counter++;
        } );
    
This discussion has been closed.