@@ -27,8 +27,10 @@ class TableBody extends Component {
27
27
'table-condensed' : this . props . condensed
28
28
} , this . props . tableBodyClass ) ;
29
29
30
+ const unselectable = this . props . selectRow . unselectable || [ ] ;
30
31
const isSelectRowDefined = this . _isSelectRowDefined ( ) ;
31
32
const tableHeader = this . renderTableHeader ( isSelectRowDefined ) ;
33
+ const inputType = this . props . selectRow . mode === Const . ROW_SELECT_SINGLE ? 'radio' : 'checkbox' ;
32
34
33
35
const tableRows = this . props . data . map ( function ( data , r ) {
34
36
const tableColumns = this . props . columns . map ( function ( column , i ) {
@@ -96,10 +98,10 @@ class TableBody extends Component {
96
98
) ;
97
99
}
98
100
} , this ) ;
99
-
101
+ const disable = unselectable . indexOf ( data [ this . props . keyField ] ) !== - 1 ;
100
102
const selected = this . props . selectedRowKeys . indexOf ( data [ this . props . keyField ] ) !== - 1 ;
101
103
const selectRowColumn = isSelectRowDefined && ! this . props . selectRow . hideSelectColumn ?
102
- this . renderSelectRowColumn ( selected ) : null ;
104
+ this . renderSelectRowColumn ( selected , inputType , disable ) : null ;
103
105
// add by bluespring for className customize
104
106
let trClassName = this . props . trClassName ;
105
107
if ( isFun ( this . props . trClassName ) ) {
@@ -112,7 +114,8 @@ class TableBody extends Component {
112
114
onRowClick = { this . handleRowClick }
113
115
onRowMouseOver = { this . handleRowMouseOver }
114
116
onRowMouseOut = { this . handleRowMouseOut }
115
- onSelectRow = { this . handleSelectRow } >
117
+ onSelectRow = { this . handleSelectRow }
118
+ unselectableRow = { disable } >
116
119
{ selectRowColumn }
117
120
{ tableColumns }
118
121
</ TableRow >
@@ -250,22 +253,13 @@ class TableBody extends Component {
250
253
}
251
254
}
252
255
253
- renderSelectRowColumn ( selected ) {
254
- if ( this . props . selectRow . mode === Const . ROW_SELECT_SINGLE ) {
255
- return (
256
- < TableColumn dataAlign = 'center' >
257
- < input type = 'radio' checked = { selected }
258
- onChange = { this . handleSelectRowColumChange } />
259
- </ TableColumn >
260
- ) ;
261
- } else {
262
- return (
263
- < TableColumn dataAlign = 'center' >
264
- < input type = 'checkbox' checked = { selected }
256
+ renderSelectRowColumn ( selected , inputType , disabled ) {
257
+ return (
258
+ < TableColumn dataAlign = 'center' >
259
+ < input type = { inputType } checked = { selected } disabled = { disabled }
265
260
onChange = { this . handleSelectRowColumChange } />
266
- </ TableColumn >
267
- ) ;
268
- }
261
+ </ TableColumn >
262
+ ) ;
269
263
}
270
264
271
265
_isSelectRowDefined ( ) {
0 commit comments