Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Data Grid › Custom column header and column group header buttons › Reply To: Custom column header and column group header buttons
Hi Patrick,
We just released a new version. You have an originalEvent parameter in the column click.
Alternatively, the column definition includes a new headerTemplate property which allows you to setup the column’s header after the label template is rendered.
Here’s the code:
` “label”: “Task ID”, allowEdit: false, “dataType”: “number”, “template”: “autoNumber”, width: 150,
labelTemplate: function () {
return “
},
headerTemplate: function (header) {
const button = header.querySelector(‘smart-button’);
button.addEventListener(‘pointerdown’, function (event) {
grid.addNewRow();
event.stopPropagation();
});
}`
Hope this helps.
Best regards,
Markov
Smart UI Team
https://www.htmlelements.com/