More code for #159

This commit is contained in:
James Cole
2016-04-03 11:07:51 +02:00
parent 23cc7be231
commit 885b56c465
8 changed files with 92 additions and 9 deletions

View File

@@ -25,24 +25,29 @@ function clickInfoButton(e) {
var element = $(e.target);
var attributes = element.data();
// set wait cursor
$('body').addClass('waiting');
// add some more elements:
attributes.startDate = startDate;
attributes.endDate = endDate;
attributes.reportType = reportType;
attributes.accounts = accountIds;
console.log(attributes);
$.getJSON('popup/report', {attributes: attributes}).success(respondInfoButton).fail(errorInfoButton);
}
function errorInfoButton(data) {
"use strict";
console.log(data);
// remove wait cursor
$('body').removeClass('waiting');
alert('Apologies. The requested data is not (yet) available.');
}
function respondInfoButton(data) {
"use strict";
console.log(123);
// remove wait cursor
$('body').removeClass('waiting');
$('#defaultModal').empty().html(data.html);
$('#defaultModal').modal('show');