react-bootstrap-table2/packages/react-bootstrap-table2-editor
2018-05-05 18:18:52 +08:00
..
src implement rich cell editor 2018-05-05 18:18:52 +08:00
test patch tests for rich editors 2018-05-05 18:18:52 +08:00
index.js implement rich cell editor 2018-05-05 18:18:52 +08:00
package.json v0.1.1 2018-01-22 00:30:26 +08:00
README.md fix #258 (#268) 2018-03-25 16:44:27 +08:00

react-bootstrap-table2-editor

react-bootstrap-table2 separate the cell edit code base to react-bootstrap-table2-editor, so there's a little bit different when you use cell edit than react-bootstrap-table. In the following, we are going to show you how to enable the cell edit

Live Demo For Cell Edit

API&Props Definitation


Install

$ npm install react-bootstrap-table2-editor --save

How

We have two ways to trigger a editable cell as editing cell:

  • click
  • dbclick

That's look into how we enable the cell edit on tabe:

import cellEditFactory from 'react-bootstrap-table2-editor';

// omit

<BootstrapTable
  keyField="id"
  data={ products }
  columns={ columns }
  cellEdit={ cellEditFactory({ mode: 'click' }) }
/>

How user save their new editings? We offer two ways:

Editable Cell

react-bootstrap-table2 support you to configure the cell editable on three level:

Customize Style/Class

Editing Cell

Editor

Validation

column.validator will help you to work on it!