Our blazing fast Grid component built with pure JavaScript


Post by Mercury »

Hello,

I want to capture the "change" event for a single row (or cell and then access the row).
Therefore I added a "finishCellEdit" event listener:

      var grid = this.$refs.grid as any;
      var finishCellEdit = {
        'finishCellEdit': () => window.console.log("edited")
      };
      grid.gridInstance.on(finishCellEdit);

Thats working and called for most of the cell types (e.g. text).
Columns with the type "check" which display a Checkbox seem to not emit this event.

Is this intended? Is there another way to listen to changes in a single data set?

Btw. I am using Typescript and Vue, but this should not be relevant for the question.

Best Regards


Post by pmiklashevich »

Cell editing is not applied to the CheckColumn. The check column renders a checkbox and you can just click it to change the value. The column provides toggle event:

new Grid({

onCheckColumnToggle({ checked, record }) {
    console.log(checked, record);
},

columns : [
    {
        text      : 'Done',
        field     : 'done',
        type      : 'check',
        listeners : {
            toggle : 'up.onCheckColumnToggle'
        }
    }, {

Pavlo Miklashevych
Sr. Frontend Developer


Post by Mercury »

Thanks, that solved my problem!


Post Reply