【问题标题】:react-bootstrap-table-next on selectRow selects all RowsselectRow 上的 react-bootstrap-table-next 选择所有行
【发布时间】:2021-01-15 06:00:51
【问题描述】:

要求:更改选择行的背景颜色:

**npm package**: "react-bootstrap-table-next": {
            "version": "4.0.3",
            "resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
            "integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
            "requires": {
                "classnames": "^2.2.5",
                "react-transition-group": "^4.2.0",
                "underscore": "1.9.1"
            }
        },

代码:

const selectRow = {
    mode: 'checkBox',
    // hideSelectColumn: false,
    clickToSelect: true,
    // clickToEdit: true,
    color: '#def3ff',

  };

 <BootstrapTable
                  mode="radio"
                  size="sm"
                  className="small"
                  bordered={false}
                  striped
                  keyField="id"
                  data={historyData}
                  columns={columnsHistoryTable}
                  rowEvents={historyRowEvent}
                  selectRow={selectRow}

                />

问题:在执行此操作时,所有行都被选中,我只需要更改所选行的颜色

【问题讨论】:

    标签: reactjs react-bootstrap-table


    【解决方案1】:
    猜你喜欢
    • 2021-06-28
    • 1970-01-01
    • 1970-01-01
    • 2020-10-29
    • 1970-01-01
    • 1970-01-01
    • 2020-11-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多