1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
// tri des lieux
$("#lieux_up").sortable({
axis: 'y',
handle: '.dragme',
cursor : 'crosshair',
stop : function() {
serial = $("#lieux_up").sortable('serialize');
$.ajax ({ type: "POST",dataType: "html", url: "ajax_locations.php", data: serial});
}
});
$("#lieux_up").disableSelection();
// ajout d un lieu manuel
$("#loc_add").click(function()
{
if($('#addlocName').val()!='')
{
// on recupere tous les champs du formulaire
var form_fields = $('form#games_loc_form').serialize();
// on les envoies en ajax
$.ajax({
type: "POST",
url: "ajax_locations.php",
data: form_fields,
dataType: "html",
beforeSend: function(){
$('#content_locations').html('');
$('#load_locations').show();
},
success: function(){
$('#load_locations').hide();
$('#content_locations').load('left_games_locations.php',function() {
$('#lieux_up', $('#content_locations')).sortable({
axis: 'y',
handle: '.dragme',
cursor : 'crosshair',
stop : function() {
serial = $("#lieux_up").sortable('serialize');
$.ajax ({ type: "POST",dataType: "html", url: "ajax_locations.php", data: serial});
}
});
}
return false;
}); |
Partager