Skip to content

Commit

Permalink
Fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Sep 21, 2017
1 parent 77e5b11 commit 603df83
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,31 +733,31 @@ export class DataTable extends Component {
}

getFrozenColumns() {
let columns = React.Children.toArray(this.props.children);
let frozenColumns = null;
if(this.props.children && this.props.children.length) {
for(let col of this.props.children) {
if(col.props.frozen) {
frozenColumns = frozenColumns||[];
frozenColumns.push(col);
}

for(let col of columns) {
if(col.props.frozen) {
frozenColumns = frozenColumns||[];
frozenColumns.push(col);
}
}

return frozenColumns;
}

getScrollableColumns() {
let columns = null;
if(this.props.children && this.props.children.length) {
for(let col of this.props.children) {
if(!col.props.frozen) {
columns = columns||[];
columns.push(col);
}
let columns = React.Children.toArray(this.props.children);
let scrollableColumns = null;

for(let col of columns) {
if(!col.props.frozen) {
scrollableColumns = scrollableColumns||[];
scrollableColumns.push(col);
}
}

return columns;
return scrollableColumns;
}

createTableHeader(columns) {
Expand Down

0 comments on commit 603df83

Please sign in to comment.