1

Hello I have an issue with PrimeReact were I cannot use onCellClick={() => console.log("clicked")} OR onCellSelect={() => console.log("select")} while having a checkbox column

<Column
          selectionMode="multiple"
          headerStyle={{ width: "3rem" }}
        ></Column>

I wanted to know if it is a known issue and if there is a workaround.

Here is a demo on codesandbox: https://codesandbox.io/s/primereact-demo-forked-6vyf5l?file=/src/App.js

Regards

I tried creating my own checkbox column. however I cant update the state of the checkbox. Since I can't pass a function/state updater.

<Column
          selectionMode="multiple"
          onClick= ...
          headerStyle={{ width: "3rem" }}
        ></Column>
Skry
  • 11
  • 1

1 Answers1

0

See my sandbox: https://codesandbox.io/s/primereact-demo-forked-9jjmhw?file=/src/App.js

CellSelection is NOT allowed in checkbox mode or radio mode but only on single select mode. It is due to this code in PrimeReact.

const allowCellSelection = () => {
    return props.cellSelection && !isRadioSelectionModeInColumn && !isCheckboxSelectionModeInColumn;
};
Melloware
  • 10,435
  • 2
  • 32
  • 62