[Feature]单选表格,行选中后再次点击可取消选中

This commit is contained in:
yangchch6 2019-06-10 16:46:36 +08:00
parent 8dd48af754
commit 558264ea73
10 changed files with 11084 additions and 18905 deletions

View File

@ -42,8 +42,15 @@ function singleSelect(Table, Radio) {
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.onRadioChange = function (value, record, index) {
var selectedRowIndex = _this.state.selectedRowIndex;
if (selectedRowIndex === index) {
_this.setState({ selectedRowIndex: '' });
_this.props.getSelectedDataFunc();
} else {
_this.setState({ selectedRowIndex: index });
_this.props.getSelectedDataFunc(record, index);
}
};
_this.getDefaultColumns = function (columns) {

29248
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@
"bee-loading": "1.1.2",
"bee-locale": "0.0.14",
"bee-menus": "^2.0.6",
"bee-radio": "2.0.10",
"bee-radio": "^2.0.11",
"bee-select": "^2.0.11",
"classnames": "^2.2.5",
"component-classes": "^1.2.6",

View File

@ -45,9 +45,15 @@ export default function singleSelect(Table, Radio) {
}
onRadioChange = (value, record, index) => {
let { selectedRowIndex } = this.state;
if(selectedRowIndex === index){
this.setState({selectedRowIndex: ''});
this.props.getSelectedDataFunc();
}else{
this.setState({selectedRowIndex: index});
this.props.getSelectedDataFunc(record,index);
}
}
getDefaultColumns=(columns)=>{
let {selectedRowIndex} = this.state;