41 lines
995 B
JavaScript
41 lines
995 B
JavaScript
$(document).ready(function()
|
|
{
|
|
$('#customRapport').live('click', function(e){
|
|
e.preventDefault();
|
|
var url = $(this).attr('href');
|
|
var title = $(this).attr('title');
|
|
var dialogOpts = {
|
|
bgiframe: true,
|
|
title: title,
|
|
width: 500,
|
|
height: 420,
|
|
modal: true,
|
|
open: function(event, ui) {
|
|
$(this).html('Chargement...');
|
|
$(this).load(url);
|
|
},
|
|
buttons: {
|
|
Valider: function() { formEnvoiCustomRapportSubmit(); },
|
|
Annuler: function() { $(this).dialog('close'); }
|
|
},
|
|
close: function() { $('#dialogcustomrapport').remove(); }
|
|
};
|
|
$('<div id="dialogcustomrapport"></div>').dialog(dialogOpts);
|
|
return false;
|
|
});
|
|
|
|
});
|
|
|
|
function formEnvoiCustomRapportSubmit(){
|
|
var url = $('#formEnvoiCustomRapport').attr('action');
|
|
$.post(url, $('#formEnvoiCustomRapport').serialize(),
|
|
function (data, textStatus) {
|
|
if (textStatus!='success'){
|
|
$('#dialogcustomrapport').html('Erreur');
|
|
} else {
|
|
$('#dialogcustomrapport').html(data);
|
|
}
|
|
}
|
|
);
|
|
}
|