starting to add select2 box for batch codes

This commit is contained in:
frankknoll
2023-04-12 17:17:32 +02:00
parent 2e70164ac6
commit 6c1f43e32b
819 changed files with 50664 additions and 750 deletions

View File

@@ -2,15 +2,18 @@ class BatchCodeTableInitializer {
#batchCodeTableElement;
#batchCodeTable;
#batchCodeSelect;
#columnSearch;
constructor(batchCodeTableElement) {
constructor({ batchCodeTableElement, batchCodeSelect }) {
this.#batchCodeTableElement = batchCodeTableElement;
this.#batchCodeSelect = batchCodeSelect;
}
initialize() {
this.#batchCodeTable = this.#createEmptyBatchCodeTable();
this.#columnSearch = new ColumnSearch(this.#batchCodeTable.column(this.#getColumnIndex('Company')));
this.#initializeBatchCodeSelect();
this.#display();
this.#initializeHistogramView();
this.#trackSearchWithGoogleAnalytics();
@@ -124,6 +127,16 @@ class BatchCodeTableInitializer {
input.select();
}
#initializeBatchCodeSelect() {
this.#batchCodeSelect.select2({ minimumInputLength: 3 });
this.#batchCodeSelect.on(
'select2:select',
function (e) {
var data = e.params.data;
console.log(data.id);
});
}
#initializeHistogramView() {
const thisClassInstance = this;
$(`#${this.#batchCodeTableElement[0].id} tbody`)