How can I add the data in a row to another table by clicking on the row.

How can I add the data in a row to another table by clicking on the row.

kaveenkaveen Posts: 1Questions: 1Answers: 0

I'm trying to make a medical prescription creating web app using npm and angular.
I want to search the drug from the database and when you click on it, the name of the drug should go to a table below.
And it should be repeated until I press a button.
I have finished designing the drug data table using angular-datatables.
I have no idea how to do this function. please help.

Answers

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    You can use row().data() to get the data of the clicked row. Not sure how this works with Angular but this example shows how to click a row and get the clicked data. You will then use row.add() to add the row to the second table.

    Kevin

This discussion has been closed.