Guest User

Untitled

a guest
Feb 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $(".selectProperty").click(function() {
  2. var tr = $(this).closest("tr").clone();
  3.  
  4. $(".selectedPropsTable tbody").append(tr);
  5. $(this).closest("tr").remove();
  6.  
  7. $(".selectedPropsTable .selectProperty").each(function() {
  8. $(this).attr("checked", false);
  9. $(this).removeClass("selectProperty");
  10. $(this).addClass("selectedProperty");
  11. });
  12.  
  13. });
  14.  
  15. $(".selectedProperty").on("click", function() {
  16. var tr = $(this).closest("tr").clone();
  17.  
  18. $(".searchTable tbody").append(tr);
  19. $(this).closest("tr").remove();
  20.  
  21. $(".searchTable .selectedProperty").each(function() {
  22. $(this).attr("checked", false);
  23. $(this).removeClass("selectedProperty");
  24. $(this).addClass("selectProperty");
  25. });
  26.  
  27. });
  28.  
  29. <table class=".searchTable">
  30. <tr>
  31. <td><input type="checkbox" class="selectProperty"></td>
  32.  
  33. <table class=".selectedPropsTable">
  34. <tr>
  35. <td><input type="checkbox" class="selectedProperty"></td>
Add Comment
Please, Sign In to add comment