I've got two tables. I need to copy each row from one table, place it into the second table, delete the row from the first table, and then, change the name of a hidden input.
I've got the whole adding and removing rows working no problem (though it could probably be streamlined). Can anybody help with the last bit?
Also, feel free to make fun of me for doing something stupid (I have no idea what I'm doing).
I've got the whole adding and removing rows working no problem (though it could probably be streamlined). Can anybody help with the last bit?
Also, feel free to make fun of me for doing something stupid (I have no idea what I'm doing).
$('#addAll').click(function() { accountTable = $('#accountUsersTable').dataTable(); groupTable = $('#groupMembersTable').dataTable(); accountTable.$('tbody tr').each(function() { var userData = accountTable.fnGetData(this); var newRowO = groupTable.fnAddData( [ userData[0], userData[1], userData[2], userData[3] ]); var newRow = groupTable.fnSettings().aoData[newRowO[0]].nTr; $('#groupMembersTable').find($(newRow)).children("input").attr("name", "addRow[]"); accountTable.fnDeleteRow(this); }); });