create.js.erb 267 B

12345
  1. var table = $('#products_table').DataTable();
  2. var newRow = $('<%= j render (@product_waste) %>');
  3. x = $('#products_table').dataTable();
  4. newRow.find('td:eq(0)').html(newRow.find('td:eq(0)').html().replace('#', x.fnGetData().length + 1));
  5. table.row.add(newRow).draw();