PropertyTable.js View 수정
This commit is contained in:
@@ -86,9 +86,9 @@ class PropertyTableView {
|
|||||||
if (checkbox) {
|
if (checkbox) {
|
||||||
checkbox.addEventListener('change', (event) => {
|
checkbox.addEventListener('change', (event) => {
|
||||||
const index = parseInt(event.target.parentElement.parentElement.parentElement.getAttribute('data-index'), 10);
|
const index = parseInt(event.target.parentElement.parentElement.parentElement.getAttribute('data-index'), 10);
|
||||||
this.propertyTable.controller.updateProperty(index, 'enabled', event.target.checked);
|
this.controller.updateProperty(index, 'enabled', event.target.checked);
|
||||||
if (this.propertyTable.controller.additionalCallback) {
|
if (this.controller.additionalCallback) {
|
||||||
this.propertyTable.controller.additionalCallback(this.model.getProperties());
|
this.controller.additionalCallback(this.model.getProperties());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -103,8 +103,8 @@ class PropertyTableView {
|
|||||||
editableInput.init(editableElement, (value) => {
|
editableInput.init(editableElement, (value) => {
|
||||||
let model = this.model.getProperties()[index];
|
let model = this.model.getProperties()[index];
|
||||||
model[editableElement.dataset.name] = value;
|
model[editableElement.dataset.name] = value;
|
||||||
if (this.propertyTable.controller.additionalCallback) {
|
if (this.controller.additionalCallback) {
|
||||||
this.propertyTable.controller.additionalCallback(this.model.getProperties());
|
this.controller.additionalCallback(this.model.getProperties());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -121,14 +121,14 @@ class PropertyTableView {
|
|||||||
console.log(event.target.getAttribute('data-index'));
|
console.log(event.target.getAttribute('data-index'));
|
||||||
const index = parseInt(event.target.getAttribute('data-index'), 10);
|
const index = parseInt(event.target.getAttribute('data-index'), 10);
|
||||||
console.log({index});
|
console.log({index});
|
||||||
this.propertyTable.controller.removeProperty(index);
|
this.controller.removeProperty(index);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const addButton = this.element.querySelector('.add_property');
|
const addButton = this.element.querySelector('.add_property');
|
||||||
if (addButton) {
|
if (addButton) {
|
||||||
addButton.addEventListener('click', (event) => {
|
addButton.addEventListener('click', (event) => {
|
||||||
this.propertyTable.controller.addProperty();
|
this.controller.addProperty();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Add button not found'); // Check if the button is not found
|
console.log('Add button not found'); // Check if the button is not found
|
||||||
@@ -140,7 +140,7 @@ class PropertyTableView {
|
|||||||
class PropertyTableController {
|
class PropertyTableController {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.view = new PropertyTableView(this.model);
|
this.view = new PropertyTableView(this.model, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(element, callback) {
|
init(element, callback) {
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ public class ApiRequestKeyValueDTO implements Serializable {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiRequestKeyValueDTO() {
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user