Skip to content

Commit

Permalink
Fixed #641 - this.props.onSelectionChange is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 committed Nov 27, 2018
1 parent 743ebdc commit 835f40b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,12 @@ export class DataTable extends Component {
else
selection = [];

this.props.onSelectionChange({originalEvent: event, value: selection});
if(this.props.onSelectionChange) {
this.props.onSelectionChange({
originalEvent: event,
value: selection
});
}
}

filterLocal(value) {
Expand Down
21 changes: 18 additions & 3 deletions src/components/datatable/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ export class TableBody extends Component {
}
}

this.props.onSelectionChange({originalEvent: event.originalEvent, value: selection});
if(this.props.onSelectionChange) {
this.props.onSelectionChange({
originalEvent: event.originalEvent,
value: selection
});
}
}
}

Expand Down Expand Up @@ -159,7 +164,12 @@ export class TableBody extends Component {
}
}

this.props.onSelectionChange({originalEvent: event.originalEvent, value: selection});
if(this.props.onSelectionChange) {
this.props.onSelectionChange({
originalEvent: event.originalEvent,
value: selection
});
}
}

onCheckboxClick(event) {
Expand All @@ -180,7 +190,12 @@ export class TableBody extends Component {
}
}

this.props.onSelectionChange({originalEvent: event.originalEvent, value: selection});
if(this.props.onSelectionChange) {
this.props.onSelectionChange({
originalEvent: event.originalEvent,
value: selection
});
}
}

isSingleSelectionMode() {
Expand Down

0 comments on commit 835f40b

Please sign in to comment.