title: DataTables move rows between tables
body: <p>I'm building a simple interface for a sql query result.</p>
  
  <p>I've choose to use DataTables and with it help I've created something like this:</p>
  
  <p><a href="http://live.datatables.net/izavon/18/edit#javascript,html,live" rel="nofollow">http://live.datatables.net/izavon/18/edit#javascript,html,live</a></p>
  
  <p>I have problem with moving rows from one table to another, right now I have 2 functions that do their job, but I would like to have one function, because my solution only works in one direction-I can move from one table to another just ones.</p>
  
  <pre><code>$(".deleteMe1").on("click", function (event) {
      var row = $(this).closest("tr").get(0);
      var addElement = oTable1.fnGetData(row);
      oTable2.fnAddData(addElement);
      // Remove Element from the source table
      var removeElement = oTable1.fnGetPosition(row);
      oTable1.fnDeleteRow(removeElement, null, true);
  });
  
  $(".deleteMe2").on("click", function (event) {
      var row = $(this).closest("tr").get(0);
      var addElement = oTable2.fnGetData(row);
      oTable1.fnAddData(addElement);
      // Remove Element from the source table
      var removeElement = oTable2.fnGetPosition(row);
      oTable2.fnDeleteRow(removeElement, null, true);
  });
  </code></pre>
  
  <p>So my questions is:<strong>How to merge above functions into one.</strong></p>