From afad2ae40f32ea677b77b28176ac07268f6fa594 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 18 Feb 2025 16:26:45 -0600 Subject: Add missing scripts. --- uploader/static/js/populations.js | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 uploader/static/js/populations.js (limited to 'uploader/static/js/populations.js') diff --git a/uploader/static/js/populations.js b/uploader/static/js/populations.js new file mode 100644 index 0000000..ded9b10 --- /dev/null +++ b/uploader/static/js/populations.js @@ -0,0 +1,40 @@ +var populationDataTable = (populationdata) => { + var lengthMenu = [10, 25, 50, 100, 1000]; + if(populationdata.length > 1000) { + lengthMenu.push(populationdata.length) + } + $("#tbl-select-population").DataTable({ + responsive: true, + lengthMenu: lengthMenu, + language: { + processing: "Processing… Please wait.", + loadingRecords: "Loading population — Please wait.", + lengthMenu: "Show _MENU_ populations", + info: "Showing _START_ to _END_ of _TOTAL_ populations" + }, + data: populationdata, + columns: [ + { + data: (apopulation) => { + return ``; + } + }, + { + data: (apopulation) => { + return ``; + } + } + ] + }); +}; + + +$(() => { + populationDataTable(JSON.parse( + $("#tbl-select-population").attr("data-populations-list"))); +}); -- cgit 1.4.1