title: How to get last inserted row from a datatable
body: <p>I'm using <a href="https://datatables.net" rel="nofollow noreferrer">datatables</a> plugin to create a datatable. I've put a button to add new rows. The new inserted row can be anywhere depends on which column the table is sorted by. I need to set an event to the button inside the row once it is inserted. So I have to get the last inserted row to do so. But I can't find a way. I've tried below but it's not working. <code>index()</code> does not returning exact index where the row really is.</p>
  
  <pre><code>var row = table.row.add({...});
  row.draw();
  var tr = $('#datatable tbody tr').get(row.index());
  </code></pre>
  
  <p>Please help. Your answer is kindly appreciated and thank you in advance.</p>