mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
20190721 release
This commit is contained in:
parent
b60e7cdd97
commit
dd101db863
@ -39,7 +39,10 @@ This is an example for [manage on expands](../storybook/index.html?selectedKind=
|
||||
## Customization
|
||||
|
||||
### Style/Class
|
||||
`expandRow.renderer` allow you to render everything in the content of expanding row. You can control the style or class by yourself. However, a expand row is wrapped by a HTML `tr` element. Currently, we don't support any ways to custom the style or class on the expanding `tr` elemnt.
|
||||
`expandRow.renderer` allow you to render everything in the content of expanding row. You can control the style or class by yourself. However, a expand row is wrapped by a HTML `tr` element(Parent row). Currently, we support following way to custom the class/style on parent row element:
|
||||
|
||||
* For the class of parent row: [`expandRow.parentClassName`](./row-expand-props.html#expandrowparentclassname-string-function)
|
||||
* For the style of parent row: N/A
|
||||
|
||||
### Expand Column
|
||||
`react-bootstrap-table2` default doesn't render a additional indicator column, just like row selection. But if you want it, you can enable it via [`expandRow.showExpandColumn`](./row-expand-props.html#expandrowshowexpandcolumn-bool)
|
||||
|
||||
@ -11,6 +11,7 @@ Definition of columns props on BootstrapTable
|
||||
|
||||
## Optional
|
||||
* [isDummyField](#columnisdummyfield-bool)
|
||||
* [type](#columntype-string)
|
||||
* [hidden](#columnhidden-bool)
|
||||
* [formatter](#columnformatter-function)
|
||||
* [formatExtraData](#columnformatextradata-any)
|
||||
@ -80,6 +81,10 @@ dataField: 'address.city'
|
||||
## column.text (**required**) - [String]
|
||||
`text` will be the column text in header column by default, if your header is not only text or you want to customize the header column, please check [`column.headerFormatter`](#columnheaderformatter-function)
|
||||
|
||||
## column.type - [String]
|
||||
Specify the data type on column. Available value so far is `string`, `number`, `bool` and `date`. Default is `string`.
|
||||
`column.type` can be used when you enable the cell editing and want to save your cell data with correct data type.
|
||||
|
||||
## column.isDummyField - [Bool]
|
||||
Sometime, you just want to have a column which is not perform any data but just some action components. In this situation, we suggest you to use `isDummyField`. If column is dummy, the [`column.dataField`](#dataField) can be any string value, cause of it's meaningless. However, please keep `dataField` as unique as possible.
|
||||
|
||||
|
||||
@ -20,17 +20,21 @@ title: Row Expand Props
|
||||
* [expandColumnPosition](#expandrowexpandcolumnposition-string)
|
||||
* [expandColumnRenderer](#expandrowexpandcolumnrenderer-function)
|
||||
* [expandHeaderColumnRenderer](#expandrowexpandheadercolumnrenderer-function)
|
||||
* [parentClassName](#expandrowparentclassname-string-function)
|
||||
|
||||
-----
|
||||
|
||||
## expandRow.renderer - [Function]
|
||||
|
||||
Specify the content of expand row, `react-bootstrap-table2` will pass the currnet row object as argument and expect this function to return a react element.
|
||||
Specify the content of expand row, `react-bootstrap-table2` will pass the two arguments and expect to return a react element:
|
||||
|
||||
* `row`: Currnet row data.
|
||||
* `rowIndex`: Currnet row index.
|
||||
|
||||
|
||||
```js
|
||||
const expandRow = {
|
||||
renderer: row => (
|
||||
renderer: (row, rowIndex) => (
|
||||
<div>
|
||||
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
|
||||
<p>You can render anything here, also you can add additional data on every row object</p>
|
||||
@ -176,4 +180,25 @@ const expandRow = {
|
||||
// ....
|
||||
)
|
||||
};
|
||||
```
|
||||
```
|
||||
|
||||
## expandRow.parentClassName - [String | Function]
|
||||
Apply the custom class name on parent row of expanded row. For example:
|
||||
|
||||
```js
|
||||
const expandRow = {
|
||||
renderer: (row) => ...,
|
||||
parentClassName: 'foo'
|
||||
};
|
||||
```
|
||||
Below case is more flexible way to custom the class name:
|
||||
|
||||
```js
|
||||
const expandRow = {
|
||||
renderer: (row) => ...,
|
||||
parentClassName: (isExpanded, row, rowIndex) => {
|
||||
if (rowIndex > 2) return 'foo';
|
||||
return 'bar';
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
27
website/blog/2019-07-21-version-bump.md
Normal file
27
website/blog/2019-07-21-version-bump.md
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
title: New Release (2019-07-21)
|
||||
author: Allen Fang
|
||||
authorURL: https://twitter.com/allenfang_tw
|
||||
---
|
||||
|
||||
## Changed Packages
|
||||
|
||||
We got following packages version bump in this release:
|
||||
|
||||
* `react-bootstrap-table-next@3.1.6`
|
||||
* `react-bootstrap-table2-editor@1.3.0`
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
### Bug fixes
|
||||
* Fixed incorrect column size when dynamic change `selectRow.hideSelectColumn`([d7e1f1d](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/1023/commits/d7e1f1dfd0fb0d25917a2380dc3660846fe7ab86))
|
||||
|
||||
|
||||
### Features
|
||||
* Support saving type of cell editing([92f1449](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/1023/commits/92f14491777688d9b6b8d2ce76fcb28e40f53f08))
|
||||
|
||||
### Enhancements
|
||||
* Enhance serveral examples and docs
|
||||
* Allow to custom the classname on the parent row of expanded row([ec4864d](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/1023/commits/ec4864da5c6807ba59abe640b0b12a432b3c5784))
|
||||
* Add `rowIndex` as second arguments for `expandRow.renderer`([db22bb9](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/1023/commits/db22bb9adbbd965c9f060f8e6f77d5fb2591f362))
|
||||
Loading…
Reference in New Issue
Block a user