OKIEWARDOYO

PHP MYSQL No.10 - fungsi saveSelection

Aug 27th, 2012
2,565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 function savePosition(){
  2.                     var items = [];
  3.                     $(".column_builder").each(function(){
  4.                         var columnId = $(this).attr("id");
  5.                         $(".item", this).each(function(i){ //order mulai dari 0
  6.                            var item = {
  7.                                id: $(this).attr("id"),
  8.                                column: columnId,
  9.                                order: i+1
  10.                            }
  11.                            items.push(item);
  12.                         });
  13.  
  14.                     });
  15.                     $("#process").html("saving...");
  16.                     var shortorder = {items : items};
  17.                         $.ajax({
  18.                           url: "http://localhost/folder/index.php?action=save",
  19.                           async: false,
  20.                           data: shortorder,
  21.                           dataType: "html",
  22.                           type: "POST",
  23.                           success: function(html){
  24.                             $("#process").html(html);
  25.                           }
  26.                         });    
  27.                 }
Advertisement
Add Comment
Please, Sign In to add comment