Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Get template
  2. var partition_attribute_row = $.ajax({type: "GET", url: '/include/mustache/partition_attribute_row.mustache', async: false}).responseText;
  3.  
  4. // Parse
  5. var html = $.parseHTML( partition_attribute_row );
  6.  
  7. // Get the columns
  8. html.col_1 = html[0].cells[0].innerHTML;
  9. html.col_2 = html[0].cells[1].innerHTML;
  10. html.col_3 = html[0].cells[2].innerHTML;
  11.  
  12. // When the add row button is clicked..
  13. var addRow = function() {
  14.     counter ++;
  15.  
  16.     t.api().row.add( [
  17.         Mustache.render( html.col_1, { counter: counter } ),
  18.         Mustache.render( html.col_2, { counter: counter } ),
  19.         Mustache.render( html.col_3, { counter: counter } )
  20.     ] );
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement