JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Grid cell events › Reply To: Grid cell events
July 4, 2022 at 11:45 am
#103339
Participant
Hi Rafa,
You can add an event listener to Grid cells like that:
const grid = document.querySelector('smart-grid');
grid.addEventListener('cellClick', function (event) {
const detail = event.detail,
cell = detail.cell,
originalEvent = detail.originalEvent,
id = detail.id,
dataField = detail.dataField,
isRightClick = detail.isRightClick,
pageX = detail.pageX,
pageY = detail.pageY;
// event handling code goes here.
})
The data field is the column’s data field and you will be able to identify the column by using that event.
Best regards,
Jack
Smart UI Team
https://www.htmlelements.com/