Skip to content

Commit

Permalink
PF4 Table: Select All checkbox updates (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaylor113 authored and dlabrecq committed Feb 13, 2019
1 parent 925cf27 commit cca6dd7
Show file tree
Hide file tree
Showing 4 changed files with 908 additions and 4 deletions.
12 changes: 12 additions & 0 deletions packages/patternfly-4/react-table/src/components/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,18 @@ class Table extends React.Component {
this.state = {
headerData: []
};
this.isSelected = this.isSelected.bind(this);
this.areAllRowsSelected = this.areAllRowsSelected.bind(this);
}

isSelected(row) {
return row.selected === true;
}

areAllRowsSelected(rows) {
return rows.every(this.isSelected);
}

render() {
const {
caption,
Expand Down Expand Up @@ -169,6 +180,7 @@ class Table extends React.Component {
sortBy,
onSort,
onSelect,
allRowsSelected: onSelect ? this.areAllRowsSelected(rows) : false,
actions,
onCollapse,
rowLabeledBy,
Expand Down
Loading

0 comments on commit cca6dd7

Please sign in to comment.