Add hidden in datatables ?

Add hidden in datatables ?

AddisonAddison Posts: 13Questions: 4Answers: 0

Hello, Please Help Me
I want to add :

Name Position
Addison[0] | Addison[0] | Staff[0] | Staff[0] |

So I can post <input type="text"> to PHP

Here the link to the page :
http://live.datatables.net/qamocifi/2/edit

The result show after click button try. But the result seems not right.

Thank you :)

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    Hi @Addison ,

    You can either add the HTML first, like this, or use row.add() to add after the DataTables initialisation.

    Cheers,

    Colin

  • AddisonAddison Posts: 13Questions: 4Answers: 0

    Thank you, @Colin
    I'm prefer row.add() after some experiment.

    table.row.add( [
    'Addison['+i+'] <input type="text" id="name['+i+']" name="name['+i+']" value="Addison['+i+']">',
    'Staff['+i+'] <input type="text" id="position['+i+']" name="position['+i+']" value="Staff['+i+']">'
    } ).draw();

    Well Done.

This discussion has been closed.