【问题标题】:How to add custom checkbox in column in react material table?如何在反应材料表的列中添加自定义复选框?
【发布时间】:2021-03-06 20:57:09
【问题描述】:

您好,我在 React 项目中使用材料表。我想在表格单元格中添加一个复选框。 例如,在 Birth year colume 中代替 1987。如何实现?

https://codesandbox.io/s/material-demo-forked-5h51b?file=/demo.js:701-911

<MaterialTable
      title="Editable Example"
      columns={state.columns}
      data={state.data}
      options={{
        selection: true
      }}
      editable={{
       //Edit Code here
      }}
    />

【问题讨论】:

    标签: javascript reactjs material-ui frontend material-table


    【解决方案1】:

    我找到了答案...在列中添加类型:'boolean'。 例如,

        {
          title: "Unit",
          field: "unit",
          type: 'boolean',
          
        },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-29
      • 2020-06-10
      • 1970-01-01
      • 2017-04-06
      • 2018-05-08
      • 2022-08-05
      • 1970-01-01
      • 2023-03-28
      相关资源
      最近更新 更多