forked from DGNum/gestioCOF
Adapte history.js pour serialize()
This commit is contained in:
parent
c7998f56f0
commit
a9eb32217f
1 changed files with 10 additions and 6 deletions
|
@ -205,17 +205,21 @@ function KHistory(options = {}) {
|
||||||
$group.find('.amount').text(amount);
|
$group.find('.amount').text(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fetch = function (fetch_options) {
|
this.fetch = function (fetch_options = {}) {
|
||||||
options = $.extend({}, this.fetch_options, fetch_options);
|
if (typeof (fetch_options) == "string")
|
||||||
var that = this;
|
data = fetch_options
|
||||||
|
else
|
||||||
|
data = $.extend({}, this.fetch_options, fetch_options);
|
||||||
|
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
|
context: this,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
url: django_urls["kfet.history.json"](),
|
url: django_urls["kfet.history.json"](),
|
||||||
method: "POST",
|
method: "GET",
|
||||||
data: options,
|
data: data,
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
for (let group of data['groups']) {
|
for (let group of data['groups']) {
|
||||||
that.add_history_group(group);
|
this.add_history_group(group);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue