#112561

I looked at the example.

In my environment itm didn’t work and then I tryed to reproduce in your demo.

I modify the code as shown below simply adding some console.log but the console.log is never executed or, better, I don’t see the message. Why ?

Tks

{ label: ‘Quantity’, dataField: ‘Quantity’, showIcon: true, align: ‘center’, icon: ‘fa-plus-circle’, cellsAlign: ‘center’, width: 120,
template: function (formatObject) {
if (!formatObject.template) {
console.log(‘Entrato’);
const data = document.createElement(‘span’);
const plus = document.createElement(‘smart-button’);
const minus = document.createElement(‘smart-button’);
plus.style.background = getChipColor(0);
minus.style.background = getChipColor(5);
plus.innerHTML = ‘<span class=”fa-plus”></span>’;
minus.innerHTML = ‘<span class=”fa-minus”></span>’;
data.innerHTML = formatObject.value;
data.style.marginLeft = ‘7px’;
plus.row = formatObject.row;
minus.row = formatObject.row;
plus.addEventListener(‘click’, () => {
const row = plus.row;
console.log(‘plus ‘);
row.getCell(‘Quantity’).value += 5;
});
minus.addEventListener(‘click’, () => {
const row = minus.row;
console.log(‘Minus ‘);
row.getCell(‘Quantity’).value -= 5;
});
const template = document.createElement(‘div’);
template.appendChild(data);
template.appendChild(minus);
template.appendChild(plus);
formatObject.template = template;
}
else {
formatObject.template.firstChild.innerHTML = formatObject.value;
const buttons = formatObject.template.querySelectorAll(‘smart-button’);
buttons[0].row = formatObject.row;
buttons[1].row = formatObject.row;
}
}