Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #103337
    Rafa Esparza

    I would like to know if it is posible set listeners in column definition of the grids. What i’m trying to do is put checkbox in a grid column and when the checkbox is checked, do something.

    thanks in advance!

     columns =[
    { label: 'Asignado', dataField: 'asignado', template: 'checkBox', editor: 'checkBox', allowEdit: true, <strong>cellListener: () => doSomething()</strong> }

    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 =,
            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,

    Smart UI Team

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.