Skip to content

Commit

Permalink
Fix undefined dataTable when data are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesdandrea committed Feb 20, 2020
1 parent a7bc75f commit cc01254
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/ibm-gantt-chart/src/jquery/treetable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ export default class GanttDataTable extends Gantt.components.TreeTable {
}

getVisibleRows() {
if (!this.$dataTable) return [];
const trs = this.$dataTable.$('tr', { filter: 'applied' });
const count = trs.length;
const result = new Array(count);
Expand Down Expand Up @@ -719,10 +720,11 @@ export default class GanttDataTable extends Gantt.components.TreeTable {
delete this.rows[i].activityRow;
}
}
this.$dataTable
.$('tr.variable-row-height')
.css({ height: 'inherit' })
.removeClass('variable-row-height');
this.$dataTable &&
this.$dataTable
.$('tr.variable-row-height')
.css({ height: 'inherit' })
.removeClass('variable-row-height');
}

expandParents(row) {
Expand Down

0 comments on commit cc01254

Please sign in to comment.