How do I get the data of each row?
There is a DataTables.
Each line has input, select, textarea. I need to loop through each line and apply $ ('input, select, textarea'). Serialize (); to send it to the server for processing one by one.
But nothing comes of it, I go around in a loop, but I get the data of the entire table for each row.
table.row (i). $ (...)looks dumb and behaves strangely. I don't remember such tricks in the documentation.
const trElem = table.row(i).node(); // tr
const $rowControls = $('input,select,textarea', trElem); // инпуты из строки
const serialized = $rowControls.serialize();
And for good reason, it would be necessary to send in one request, and not each line separately. Today there are a couple of dozen, and tomorrow 12,000.Anonymous
To place the code, please use CodePen or similar tool. Thanks you!