modifié : SRC/public/js/ListeOeuvre.js

This commit is contained in:
sidya82 2015-02-19 18:44:40 +01:00
parent b54fd5e95f
commit 4fac5f8726
1 changed files with 50 additions and 49 deletions

View File

@ -1,5 +1,5 @@
$(document).ready( function() {
console.log( "document loaded" ); //Selection d'une recherche d'oeuvre
$('.listeoeuvre').click(function() { $('.listeoeuvre').click(function() {
$('#oeuvrePic').empty(); $('#oeuvrePic').empty();
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
@ -25,31 +25,32 @@ $(document).ready( function() {
}); });
}); });
$('.listeoeuvre').click(function() {
$('#oeuvrePic').empty(); //Enregistrement d'une liste d'ouevre
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); $('#enregistrer').click(function() {
url = "/setListOeuvres/" + $(this).children('.idListeOeuvre').val();
dataSend = { idListeOeuvre : 1,
oeuvres : "1-2-3-4"};
$.post(url, $.post(url,
dataSend, dataSend,
function( data ) { function( data ) {
}, "json" ) ;
})
.done(function() { .done(function() {
$("#oeuvrePic").append('<div class="alert alert-sucess">' $("#oeuvrePic").append('<div class="alert alert-sucess">'
+'<ul>' +'<ul>'
+'<li>Sauvegarde valider</li>' +'<li>Sauvegarde validée</li>'
+'</ul>' +'</ul>'
+'</div>' +'</div>');
}) })
.fail(function() { .fail(function() {
$("#oeuvrePic").append('<div class="alert alert-danger">' $("#oeuvrePic").append('<div class="alert alert-danger">'
+'<strong>Oouups!</strong> Il y a un problème.<br><br>' +'<strong>Oouups!</strong> Il y a un problème.<br><br>'
+'<ul>' +'<ul>'
+'<li>Erreur lors de la récupération</li>' +'<li>Erreur lors de l\'envoie</li>'
+'</ul>' +'</ul>'
+'</div>' +'</div>');
);
}); });
}); });
});