diff --git a/vaadin-grid-table-row.html b/vaadin-grid-table-row.html
index 69960813b..3d3c79492 100644
--- a/vaadin-grid-table-row.html
+++ b/vaadin-grid-table-row.html
@@ -99,20 +99,21 @@
},
_updateCells: function() {
- // columns > cells means that there is an extra col for multiselection
- var multiSel = this.columns.length > this.cells.length ? 1 : 0;
+ // Extra columns are used for multi-selection or hierarchy.
+ var extraColumns = this.columns.length > this.cells.length ? 1 : 0;
for (var i = 0, l = this.cells.length, colspan; i < l; i += colspan) {
var cell = this.cells[i];
colspan = cell.colspan || 1;
- var width = this.columns[i + multiSel].width;
- var flex = this.columns[i + multiSel].flex;
+ var width = this.columns[i + extraColumns].width;
+ var flex = this.columns[i + extraColumns].flex;
- // Visit colspanned cells to hide then and increase width and flex of parent
+ // Visit colspanned cells to hide them, and increase parent width and flex.
for (var j = 1; j < colspan && i + j < l; j++) {
this.cells[i + j].style.display = 'none';
- width = width + ' + ' + this.columns[i + multiSel + j].width;
- flex += this.columns[i + multiSel + j].flex;
+
+ width = width + ' + ' + this.columns[i + extraColumns + j].width;
+ flex += this.columns[i + extraColumns + j].flex;
}
cell.style.flexBasis = 'calc(' + width + ')';