starting to add select2 box for batch codes
This commit is contained in:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user