dynamic form import

dynamic form import

montoyammontoyam Posts: 568Questions: 136Answers: 5

I am trying to create a dynamic dataTable from an ajax call that has input boxes in the second column like in this example:

In the example the text boxes are hard coded. Can they be created dynamically?

Also, in the example, the button grabs only the input boxes. I will need to get the row data including the inputs. Is this possible?

here is a sample I threw together:

This question has an accepted answers - jump to answer


  • kthorngrenkthorngren Posts: 17,688Questions: 25Answers: 4,197
    edited February 2022 Answer ✓

    You can use columns.defaultContent or columns.render to render the inputs. If you want to populate the input with data from the row then use columns.render.

    There are lots of ways to do this depending on your needs. Generally I like to update the Datatables data cache with the input changes. I updated your test case with a columns.render function to display a text input with the default being the data for that column.

    I added an event handler for the position input that updates the Datatables cache with the changed data. I updated the Process Data button to get all the rows with rows().data(). Note the use of toArray() to turn the result into a Javascript array.



  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    yes, this was awesome. thank you so much!!

Sign In or Register to comment.