Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Data Grid › Grid template as button › Reply To: Grid template as button
The problem seems to be more complex.
I’ setted the template as shown below and the button is allways shown but clicking the button sometimes it works and sometime it doesn’t.
To be more clear sometime I see “Piu” and the new page opens; sometime I see “Passo di qui” and “Passo di qua” on the console.
Why ?
tks
{label : ‘Quantity’, dataField : ‘XXX_Q’, showIcon: true, align: ‘center’, icon: ‘fa-plus-circle’, cellsAlign: ‘center’, width: 120,
template: function(formatObject) {
if (!formatObject.template) {
console.log(“Passo di qui”);
const plus = document.createElement(‘smart-button’);
plus.innerHTML = ‘<span class=”fa fa-plus cfg-button-font-icon”></span>’;
plus.addEventListener(‘click’, () => {
console.log(“Più”);
window.open(“https://www.w3schools.com”);
});
const template = document.createElement(‘div’);
template.appendChild(plus);
formatObject.template = template;
}
else {
console.log(“Passo di qua”);
}
}
},
-
This reply was modified 9 months, 2 weeks ago by
tbettinazzi@axioma.it.
-
This reply was modified 9 months, 2 weeks ago by
tbettinazzi@axioma.it.
-
This reply was modified 9 months, 2 weeks ago by
tbettinazzi@axioma.it.