Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/features/expandable/js/expandable.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
* </pre>
* @param {GridRow} row the row that was expanded
*/
rowExpandedBeforeStateChanged: function(scope,row){
},
rowExpandedStateChanged: function (scope, row) {
}
}
Expand Down Expand Up @@ -187,9 +189,15 @@
},

toggleRowExpansion: function (grid, row) {
// trigger the "before change" event. Can change row height dynamically this way.
grid.api.expandable.raise.rowExpandedBeforeStateChanged(row);
row.isExpanded = !row.isExpanded;
if (angular.isUndefined(row.expandedRowHeight)){
row.expandedRowHeight = grid.options.expandableRowHeight;
}

if (row.isExpanded) {
row.height = row.grid.options.rowHeight + grid.options.expandableRowHeight;
row.height = row.grid.options.rowHeight + row.expandedRowHeight;
}
else {
row.height = row.grid.options.rowHeight;
Expand Down
7 changes: 6 additions & 1 deletion src/features/expandable/less/expandable.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
}

}
}


.ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell{
pointer-events: none;
}
.ui-grid-expandable-buttons-cell i{
pointer-events: all;
}

.scrollFiller {
float:left;
border:1px solid @borderColor;
}

.ui-grid-expandable-buttons-cell { }
2 changes: 1 addition & 1 deletion src/features/expandable/templates/expandableRow.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
ng-if="expandableRow.shouldRenderExpand()"
class="expandableRow"
style="float:left; margin-top: 1px; margin-bottom: 1px"
ng-style="{width: (grid.renderContainers.body.getCanvasWidth()) + 'px', height: grid.options.expandableRowHeight + 'px'}">
ng-style="{width: (grid.renderContainers.body.getCanvasWidth()) + 'px', height: row.expandedRowHeight + 'px'}">
</div>
4 changes: 2 additions & 2 deletions src/features/expandable/templates/expandableScrollFiller.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div
ng-if="expandableRow.shouldRenderFiller()"
ng-class="{scrollFiller:true, scrollFillerClass:(colContainer.name === 'body')}"
ng-style="{ width: (grid.getViewportWidth()) + 'px', height: grid.options.expandableRowHeight + 2 + 'px', 'margin-left': grid.options.rowHeader.rowHeaderWidth + 'px' }">
ng-style="{ width: (grid.getViewportWidth()) + 'px', height: row.expandedRowHeight + 2 + 'px', 'margin-left': grid.options.rowHeader.rowHeaderWidth + 'px' }">
<i
class="ui-grid-icon-spin5 ui-grid-animate-spin"
ng-style="{'margin-top': ( grid.options.expandableRowHeight/2 - 5) + 'px', 'margin-left' : ((grid.getViewportWidth() - grid.options.rowHeader.rowHeaderWidth)/2 - 5) + 'px'}">
ng-style="{'margin-top': ( row.expandedRowHeight/2 - 5) + 'px', 'margin-left' : ((grid.getViewportWidth() - grid.options.rowHeader.rowHeaderWidth)/2 - 5) + 'px'}">
</i>
</div>