//Selection d'une recherche d'oeuvre
$('.listeoeuvre').click(function() {
$('#oeuvrePic').empty();
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
$.get(url, function( data ) {
if (data.length == 0 )
$("#oeuvrePic").append("Aucune Oeuvre");
data.forEach( function(el) {
$("#oeuvrePic").append('
');
})
}, "json" )
.fail(function() {
$("#oeuvrePic").append(''
+'
Oouups! Il y a un problème.
'
+'
'
+'- Erreur lors de la récupération
'
+'
'
+'
'
);
});
});
//Enregistrement d'une liste d'ouevre
$('#enregistrer').click(function() {
url = "setListOeuvres";
dataSend = {
_token : $('#_token').val(),
idListeOeuvre : "1",
oeuvres : "1-2-3-4"};
$.post(url,
dataSend,
function( data ) {
;
}, "json")
.done(function() {
$("#oeuvrePic").append(''
+'
'
+'- Sauvegarde validée
'
+'
'
+'
');
})
.fail(function() {
$("#oeuvrePic").append(''
+'
Oouups! Il y a un problème.
'
+'
'
+'- Erreur lors de l\'envoie
'
+'
'
+'
');
});
});