From 324cf356f31f86c3ff030c665d9b7ab3904d7eb1 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 5 Jun 2018 14:33:14 +0200 Subject: [PATCH] filtering by voucher partners added --- smash/web/static/js/smash.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/smash/web/static/js/smash.js b/smash/web/static/js/smash.js index dd85b76a..45122991 100644 --- a/smash/web/static/js/smash.js +++ b/smash/web/static/js/smash.js @@ -216,6 +216,7 @@ function createTable(params) { var appointment_types_url = params.appointment_types_url; var subjects_url = params.subjects_url; var voucher_types_url = params.voucher_types_url; + var voucher_partner_url = params.voucher_partner_url; var columnsDefinition = params.columns; tableElement.appendChild(createHeader(columnsDefinition)); @@ -286,6 +287,18 @@ function createTable(params) { }); }); + $(tableElement).find('tfoot div[name="voucher_partner_filter"]').each(function () { + var obj = $(this); + obj.html('<select style="width:80px"><option value selected="selected">---</option></select>'); + var select = $('select', obj); + $.get(voucher_partner_url, function (content) { + $.each(content.data, function (index, voucher_partner) { + select.append('<option value="' + voucher_partner.id + '">' + voucher_partner.first_name + ' ' + + voucher_partner.last_name + ' ' + '</option>'); + }); + }); + }); + $(tableElement).find('tfoot div[name="flying_team_filter"]').each(function () { var obj = $(this); obj.html('<select style="width:80px"><option value selected="selected">---</option></select>'); -- GitLab