Skip to content

Type.CHECKBOX always shows unchecked when click cell to edit value #1183

@rikinshah23

Description

@rikinshah23

Bug description:
When using colunmns.editor as CHECKBOX type, Checked checkbox is shown as Unchecked when clicking on it to update its value.

Steps:

  1. Create BootstrapTable with cell Edit props for columns.editor type CHECKBOX.
  2. Make checkboxes true by default (for testing)
  3. now click on checkbox cell to edit its value
  4. Notice - When you click the CHECKED checkbox cell to edit it, it shows Unchecked already while in edit mode. Below images will show it more clearly.

Screenshots:
for example : my grid has 4 checkboxes, 2 of which are currently True.

image

Now I am clicking on first cell to UnCheck the checkbox.

image

Notice 2 things in above image -

  1. I just clicked the first cell and it shows unchecked checkbox without changing its value. its original value is checked.
    shouldn't it show Checked box?

  2. Why checkbox comes on left side when in edit mode?

my checkbox column is like this:

        {
            dataField: 'isActive',
            sort: true,
            text: 'Status',
             editor: {
                    type: Type.CHECKBOX,
                    value: 'Y:N'
                },
            formatter: (cell, row, rowIndex) => {
                //     console.log(cell, row)
                return (
                    <Input type="checkbox" style={{ marginLeft: 90 }} checked={cell} ></Input>
                );
            },
        },

codesandbox sample -
https://bdnuf.sse.codesandbox.io/
In above example - all 4 checkboxes are set to true initially.
Try to click any of the cell for checkbox and notice that it shows as false value.

Expected - It should show as its original value which is true in this case.

Please help

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions