From 81d348481c9186ba07d457ae9366e906b5dc29d9 Mon Sep 17 00:00:00 2001 From: Ghislain Beaulac Date: Fri, 24 May 2019 10:16:16 -0400 Subject: [PATCH] feat(rowDetail): add option to limit expanded row to only 1, closes #194 --- src/app/examples/grid-rowdetail.component.ts | 3 +++ .../angular-slickgrid/models/rowDetailView.interface.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/app/examples/grid-rowdetail.component.ts b/src/app/examples/grid-rowdetail.component.ts index bf43a52e5..3b8695e92 100644 --- a/src/app/examples/grid-rowdetail.component.ts +++ b/src/app/examples/grid-rowdetail.component.ts @@ -91,6 +91,9 @@ export class GridRowDetailComponent implements OnInit { // load only once and reuse the same item detail without calling process method loadOnce: true, + // limit expanded row to only 1 at a time + singleRowExpand: false, + // false by default, clicking anywhere on the row will open the detail view // when set to false, only the "+" icon would open the row detail // if you use editor or cell navigation you would want this flag set to false (default) diff --git a/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts b/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts index 02af9b162..506cd5c78 100644 --- a/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts +++ b/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts @@ -32,6 +32,9 @@ export interface RowDetailView { /** Defaults to true, which will save the row detail view in a cache when it detects that it will become out of the viewport buffer */ saveDetailViewOnScroll?: boolean; + /** Defaults to false, which will limit expanded row to only 1 at a time (it will close all other rows before opening new one). */ + singleRowExpand?: boolean; + /** * Defaults to false, which will use a simpler way of calculating when rows become out (or back) of viewport range. * It is recommended to enable this flag since it seems to work correctly with Aurelia-Slickgrid while the inverse is misbehaving