add row id in datatable code example
Example 1: datatables add row
const table = $("#yourTable").DataTable();
table.row.add( /* array or object */).draw();
// or using tr
const tr = $("<tr><td>1</td><td>2</td></tr>");
table.row.add(tr[0]).draw();
// you must call draw() to see your changes
Example 2: datatable set row id
var table = $("#tablid").DataTable();
var row = table.row("[id='"+id+"']");
row.row("[id='" + id + "']").data([x0, x1, x2, x3]);
row.draw();