publish 1.2.5
This commit is contained in:
parent
da3be3d87b
commit
20d9185ba8
|
@ -52,14 +52,18 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
data = _this$state.data,
|
data = _this$state.data,
|
||||||
checkedAll = _this$state.checkedAll;
|
checkedAll = _this$state.checkedAll;
|
||||||
|
|
||||||
|
var selectList = [];
|
||||||
var check = checkedAll ? false : true;
|
var check = checkedAll ? false : true;
|
||||||
data.forEach(function (item) {
|
data.forEach(function (item) {
|
||||||
item.checked = check;
|
item.checked = check;
|
||||||
|
if (item.checked) {
|
||||||
|
selectList.push(item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
_this.setState({
|
_this.setState({
|
||||||
checkedAll: check
|
checkedAll: check
|
||||||
});
|
});
|
||||||
_this.props.getSelectedDataFunc(data);
|
_this.props.getSelectedDataFunc(selectList);
|
||||||
};
|
};
|
||||||
|
|
||||||
_this.handleClick = function () {};
|
_this.handleClick = function () {};
|
||||||
|
@ -68,6 +72,7 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
return function () {
|
return function () {
|
||||||
var data = _this.state.data;
|
var data = _this.state.data;
|
||||||
|
|
||||||
|
var selectList = [];
|
||||||
record.checked = record.checked ? false : true;
|
record.checked = record.checked ? false : true;
|
||||||
var checkedAll = true;
|
var checkedAll = true;
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
@ -80,7 +85,12 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
_this.setState(_extends({}, _this.state, {
|
_this.setState(_extends({}, _this.state, {
|
||||||
checkedAll: checkedAll
|
checkedAll: checkedAll
|
||||||
}));
|
}));
|
||||||
_this.props.getSelectedDataFunc(record);
|
data.forEach(function (da) {
|
||||||
|
if (da.checked) {
|
||||||
|
selectList.push(da);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_this.props.getSelectedDataFunc(selectList);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -217,8 +217,8 @@ class Demo25 extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <div className="demo25"><DragColumnTable
|
return <div className="demo25"><DragColumnTable
|
||||||
columns={getCloumns()}
|
columns={columns25}
|
||||||
data={dataList}
|
data={data25}
|
||||||
getSelectedDataFunc={this.getSelectedDataFunc}
|
getSelectedDataFunc={this.getSelectedDataFunc}
|
||||||
bordered
|
bordered
|
||||||
dragborder={true}
|
dragborder={true}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bee-table",
|
"name": "bee-table",
|
||||||
"version": "1.2.4",
|
"version": "1.2.5",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
|
@ -40,14 +40,18 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
|
|
||||||
onAllCheckChange=()=>{
|
onAllCheckChange=()=>{
|
||||||
let {data,checkedAll} = this.state;
|
let {data,checkedAll} = this.state;
|
||||||
|
let selectList = [];
|
||||||
let check = checkedAll?false:true;
|
let check = checkedAll?false:true;
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
item.checked = check;
|
item.checked = check;
|
||||||
|
if(item.checked){
|
||||||
|
selectList.push(item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
checkedAll:check
|
checkedAll:check
|
||||||
});
|
});
|
||||||
this.props.getSelectedDataFunc(data);
|
this.props.getSelectedDataFunc(selectList);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick=()=>{
|
handleClick=()=>{
|
||||||
|
@ -56,6 +60,7 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
|
|
||||||
onCheckboxChange = (text, record, index) => () => {
|
onCheckboxChange = (text, record, index) => () => {
|
||||||
let {data} = this.state;
|
let {data} = this.state;
|
||||||
|
let selectList = [];
|
||||||
record.checked = record.checked?false:true;
|
record.checked = record.checked?false:true;
|
||||||
let checkedAll = true;
|
let checkedAll = true;
|
||||||
for(let i=0;i<data.length;i++){
|
for(let i=0;i<data.length;i++){
|
||||||
|
@ -69,7 +74,12 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
...this.state,
|
...this.state,
|
||||||
checkedAll
|
checkedAll
|
||||||
})
|
})
|
||||||
this.props.getSelectedDataFunc(record);
|
data.forEach((da)=>{
|
||||||
|
if(da.checked){
|
||||||
|
selectList.push(da);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.props.getSelectedDataFunc(selectList);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue