From 10586e3abf0922f742a0bdc8dd5a5c719d1e7c82 Mon Sep 17 00:00:00 2001 From: dm5wk Date: Thu, 23 May 2024 18:00:11 +0200 Subject: [PATCH] automatically add all columns --- band-plan.html | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/band-plan.html b/band-plan.html index 856844f..4c3aa41 100644 --- a/band-plan.html +++ b/band-plan.html @@ -88,16 +88,6 @@ div#togglebuttons>button { } } - function debug_tdata(s, tdata) { - if (tdata.length > 0) { - console.log(s + " " + tdata.length + " " + tdata[tdata.length - 1].frequency + " " + tdata[tdata.length - 1].power_a); - //console.log(s + " " + tdata.length); - //tdata.forEach((t) => { - // console.log(s + " " + t.frequency); - //}); - } - } - function update_table(bands, additions) { var tdata = []; bands.forEach((band) => { @@ -110,9 +100,6 @@ div#togglebuttons>button { "bandwidth": band.bandwidth, "description": part.description, "frequency": typeof part.at !== "undefined" ? part.at : part.start + '\u2013' + part.end, - //"at": part.at, - //"start": part.start, - //"end": part.end, }; let parts_already_added = false; additions.forEach((add) => { @@ -170,21 +157,16 @@ div#togglebuttons>button { ], selectableRows: true, data: tdata, - columns: [ - // eslint-disable-next-line no-unused-vars - {title: "band", field: "band", headerFilter: "input", sorter: function(a, b, aRow, bRow, column, dir, sorterParams){ - return parseFloat(new Measures().from(a).to('m')) - parseFloat(new Measures().from(b).to('m')); - }}, - {title: "frequency/kHz", field: "frequency", sorter: "number", headerFilter: "input", headerFilterFunc: filter_with_not}, - {title: "bandwidth/Hz", field: "bandwidth", headerFilter: "input", headerFilterFunc: filter_with_not}, - {title: "mode", field: "mode", headerFilter: "input", headerFilterFunc: filter_with_not}, - //{title: "band_start", field: "band_start", headerFilter: "input"}, - //{title: "band_end", field: "band_end", headerFilter: "input"}, - {title: "description", field: "description", headerFilter: "input", headerFilterFunc: filter_with_not}, - {title: "power_a", field: "power_a", headerFilter: "input", headerFilterFunc: filter_with_not}, - {title: "power_e", field: "power_e", headerFilter: "input", headerFilterFunc: filter_with_not}, - {title: "power_n", field: "power_n", headerFilter: "input", headerFilterFunc: filter_with_not}, - ], + autoColumns:"full", + // add filter for all columns + autoColumnsDefinitions: function(definitions){ + definitions.forEach((column) => { + column.headerFilter = "input"; + column.headerFilterFunc = filter_with_not; + }); + + return definitions; + }, }); document.getElementById("download").addEventListener("click", () => {