[Vuejs]-Ag-grid focus checkbox when cell is selected

1👍

You can listen to cellKeyDown event from AgGridVue like so:

    <AgGridVue
      style="height: 100vh; width: 100%"
      class="ag-theme-alpine"
      :columnDefs="columnDefs"
      :rowData="rowData"
      @cellKeyDown="onKeyDownHandler($event)" 
    />

And add method/function:

    function onKeyDownHandler(params) {
      const { colId } = params.column;
      if (colId === 'isValid' && params.event.code === 'Space') {
        params.node.setDataValue(colId, !params.value);
      }
    }

That checks if key was pressed in your isValid column, and that it is Space key, if it is, it toggles the cells value.

Here’s a quick sandbox/stackblitz: https://stackblitz.com/edit/vue-khblqw?file=src/App.vue

Leave a comment