From 08e04e0b14c26b483a1bc5578f30b0eccec21d5f Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 22 Feb 2016 18:51:45 +0800 Subject: [PATCH] Hide selection component in children data --- .../table/demo/{indent-size.md => expand-children.md} | 2 +- components/table/index.jsx | 1 + package.json | 2 +- style/components/table.less | 9 +++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) rename components/table/demo/{indent-size.md => expand-children.md} (95%) diff --git a/components/table/demo/indent-size.md b/components/table/demo/expand-children.md similarity index 95% rename from components/table/demo/indent-size.md rename to components/table/demo/expand-children.md index 86988a8463..7577deb3ab 100644 --- a/components/table/demo/indent-size.md +++ b/components/table/demo/expand-children.md @@ -78,7 +78,7 @@ const data = [{ }]; ReactDOM.render( - , +
, mountNode ); ```` diff --git a/components/table/index.jsx b/components/table/index.jsx index 599cc2af4c..7b99c71a29 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -584,6 +584,7 @@ let AntTable = React.createClass({ data={data} columns={columns} className={classString} + expandIconColumnIndex={columns[0].key === 'selection-column' ? 1 : 0} expandIconAsCell={expandIconAsCell} /> {emptyText} diff --git a/package.json b/package.json index 64f03ae539..cde948dac2 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rc-slider": "~3.3.0", "rc-steps": "~1.4.1", "rc-switch": "~1.3.2", - "rc-table": "~3.9.0", + "rc-table": "~3.10.1", "rc-tabs": "~5.7.0", "rc-time-picker": "~1.1.0", "rc-tooltip": "~3.3.1", diff --git a/style/components/table.less b/style/components/table.less index 6970bed99d..17821ccf69 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -318,6 +318,15 @@ content: '.'; } } + + // Hide selection component in children data + &[class*="@{table-prefix-cls}-row-level-"] .@{table-prefix-cls}-selection-column > span { + display: none; + } + + &[class*="@{table-prefix-cls}-row-level-0"] .@{table-prefix-cls}-selection-column > span { + display: inline-block; + } } tr&-expanded-row { &,