How to disable selection of cells in ag-grid?

后端 未结 5 1654
暖寄归人
暖寄归人 2021-01-01 12:03

I have a simple ag-grid in an Angular project and want to disable selection of cells in one of its columns. Simply removing the default blue outline during selection would

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 12:36

    You can also use cellStyle to remove the selection dynamically. Here is an example:

    {
      headerName: "Is Selectable",
      cellStyle: (params) => {
        if (!params.value) {
          return { border: "none" };
        }
        return null;
      },
      ...
    },
    {
      headerName: "UnSelectable",
      cellStyle: { border: "none" },
      ...
    }
    

    Live Demo

提交回复
热议问题