popup: {
minWidth: 400,
on: {
onViewInit(name, config) {
if (name === "fields") {
config.view = "tree";
config.activeTitle = true;
config.template = (item, common) => {
const value = item.$count ? item.value : item.text;
return `${common.icon(item, common) +
common.folder(item, common)}<span>${value}</span> ${
item.$count
? ""
: `<button class="delbtn">del</button> <button class="edit">edit</button>`
}`;
}
How to add handlers (click) for buttons with classes “delbtn” and “edit”?