Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.39 KB | None | 0 0
  1. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
  2. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  3. <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
  4. <div class="row" style="background-color: greenyellow">
  5.     <div class="columns medium-6" style="background-color: #a8e4ff">
  6.         <h3>Adatbázisban létező tulajdonságok</h2>
  7.         <ul id="sortable1" class="sortable_list connectedSortable">
  8.             {foreach $attributes as $attr}
  9.                 <li class="ui-state-default">{$attr.name}</li>
  10.             {/foreach}
  11.             </li>
  12.         </ul>
  13.     </div>
  14.     <div class="columns medium-6" style="background-color: #FFE45C">
  15.         <h3>Termék tulajdonságok</h2>
  16.         <ul id="sortable2" class="sortable_list connectedSortable" data-empty-message="You have no unread messages">
  17.             {foreach $productAttributesss as $prodAttr}
  18.                 <li class="ui-state-highlight"><span>{$prodAttr.name} - {$prodAttr.priority}</span></li>
  19.             {/foreach}
  20.         </ul>
  21.     </div>
  22. </div>
  23.        
  24. <style>
  25.     #sortable2 {
  26.         border: 1px solid #eee;
  27.         min-height: 40px;
  28.         padding-bottom: 5px;
  29.     }
  30.  
  31.     #sortable1 li, #sortable2 li {
  32.         margin: 0 5px 5px 5px;
  33.         padding: 5px;
  34.     }
  35. </style>
  36.  
  37. <script>
  38. $(function() {
  39.     $( ".sortable_list" ).sortable({
  40.         connectWith: ".connectedSortable"
  41.     }).disableSelection();
  42. });
  43.  
  44. </script>
  45. <script>
  46. $(function() {
  47.     $( ".sortable_list" ).sortable({
  48.         connectWith: ".connectedSortable",
  49.         opacity: 0.5,
  50.         cursor: 'move',
  51.         tolerance: 'pointer',
  52.         revert: false,
  53.         items:'li',
  54.         placeholder: 'state',
  55.         forcePlaceholderSize: true,
  56.         data: $(this).sortable("serialize"),
  57.         update: function(e, ui){
  58.             newOrder = $(this).sortable("serialize");
  59.             console.log(newOrder);
  60.             $.ajax({
  61.                     url: "/admin/dashboard/save_order",
  62.                     type: "POST",
  63.                     data: newOrder,
  64.                     // complete: function(),
  65.                     success: function(feedback){
  66.                          $("#test").html(feedback);
  67.                          //$.jGrowl(feedback, { theme: 'success' });
  68.                     }
  69.                     });
  70.                 }
  71.                
  72.         });
  73. });
  74. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement