From dd101db8633a2dfc6bc0ff4ef91bf199a0f6c8e0 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 21 Jul 2019 17:45:02 +0800 Subject: [PATCH] 20190721 release --- docs/basic-row-expand.md | 5 +++- docs/column-props.md | 5 ++++ docs/row-expand-props.md | 31 ++++++++++++++++++++++--- website/blog/2019-07-21-version-bump.md | 27 +++++++++++++++++++++ 4 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 website/blog/2019-07-21-version-bump.md diff --git a/docs/basic-row-expand.md b/docs/basic-row-expand.md index a8a4c5e..4983175 100644 --- a/docs/basic-row-expand.md +++ b/docs/basic-row-expand.md @@ -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) diff --git a/docs/column-props.md b/docs/column-props.md index bdea680..16ee1ee 100644 --- a/docs/column-props.md +++ b/docs/column-props.md @@ -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. diff --git a/docs/row-expand-props.md b/docs/row-expand-props.md index 401b87d..d11598f 100644 --- a/docs/row-expand-props.md +++ b/docs/row-expand-props.md @@ -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) => (

{ `This Expand row is belong to rowKey ${row.id}` }

You can render anything here, also you can add additional data on every row object

@@ -176,4 +180,25 @@ const expandRow = { // .... ) }; -``` \ No newline at end of file +``` + +## 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'; + } +}; +``` diff --git a/website/blog/2019-07-21-version-bump.md b/website/blog/2019-07-21-version-bump.md new file mode 100644 index 0000000..e167529 --- /dev/null +++ b/website/blog/2019-07-21-version-bump.md @@ -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)) \ No newline at end of file