submit table data

submit table data

mikeD123mikeD123 Posts: 12Questions: 6Answers: 0

i want to submit the rows of data as an array when i submit the form. the columns would have to be inputs.
how do i define the columns as input for dynamic table so the will be in form post?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 6,889Questions: 0Answers: 1,176

    Hi @mikeD123 ,

    Is this using Editor? If not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • mikeD123mikeD123 Posts: 12Questions: 6Answers: 0

    i am not using editor. i just want to have my table rows in my form data when i click submit. i see examples but they all have the TDs in the html.
    since table is built dynamically i wanted to know if there was a column type i could set so the column would have Input tag so it is selected with form.
    do i need editor to have TDs contain inputs, or is there another way to have rows in form data?

  • kthorngrenkthorngren Posts: 7,000Questions: 22Answers: 1,525
    Answer ✓

    You can render the input html using columns.render. The docs have some examples showing links but the same concept applies.

    When you submit the for you will use jQuery ajax to send the update to the server. I would recommend similar behavior as Editor in that the response contain the updated DB data then update the Datatable row with the response data. This way you know the Datatable data and the DB match. How you implement this is up to you as it is outside of Datatables.

    Kevin

Sign In or Register to comment.