react-bootstrap-table/react-bootstrap-table2

Display column Type.CHECKBOX as checkbox even when not being edited

Open

#784 创建于 2019年2月6日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)JavaScript (1,249 star) (415 fork)batch import
cell-editorhelp wanted

描述

In the table I'm using, it's quite natural to display a true/false state as a checked or unchecked checkbox. This doesn't seem to be supported out of the box but by using a formatter which renders it as a checkbox I can make it work. It takes an extra click to make it editable and it will then change state as expected.

Is there a way to render this that doesn't require the extra click?

Thanks,

  Ben.
const columns = [
   ..., {
        dataField: 'selected',
        text: 'Selected',
        formatter: (cell) => <Checkbox checked={cell} />,
        editor: {
            type: Type.CHECKBOX
        }
    }
];

贡献者指南

Display column Type.CHECKBOX as checkbox even when not being edited · react-bootstrap-table/react-bootstrap-table2#784 | Good First Issue