Skip to content

Commit

Permalink
docs: add missing RowDetail pre-registering
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Oct 19, 2024
1 parent a2f4aa5 commit 0037684
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/grid-functionalities/row-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export class GridExample {
rowSelectionOptions: {
selectActiveRow: true
},
preRegisterExternalExtensions: (pubSubService) => {
// Row Detail View is a special case because of its requirement to create extra column definition dynamically
// so it must be pre-registered before SlickGrid is instantiated, we can do so via this option
const rowDetail = new SlickRowDetailView(pubSubService as EventPubSubService);
return [{ name: ExtensionName.rowDetailView, instance: rowDetail }];
},
rowDetailView: {
// We can load the "process" asynchronously via Fetch, Promise, ...
process: (item) => this.http.get(`api/item/${item.id}`),
Expand Down Expand Up @@ -250,6 +256,12 @@ export class GridExample {
getGridOptions(): GridOption {
return {
enableRowDetailView: true,
preRegisterExternalExtensions: (pubSubService) => {
// Row Detail View is a special case because of its requirement to create extra column definition dynamically
// so it must be pre-registered before SlickGrid is instantiated, we can do so via this option
const rowDetail = new SlickRowDetailView(pubSubService as EventPubSubService);
return [{ name: ExtensionName.rowDetailView, instance: rowDetail }];
},
rowDetailView: {
// We can load the "process" asynchronously via Fetch, Promise, ...
process: (item) => this.http.get(`api/item/${item.id}`),
Expand Down Expand Up @@ -287,6 +299,12 @@ export class GridExample {
getGridOptions(): GridOption {
return {
enableRowDetailView: true,
preRegisterExternalExtensions: (pubSubService) => {
// Row Detail View is a special case because of its requirement to create extra column definition dynamically
// so it must be pre-registered before SlickGrid is instantiated, we can do so via this option
const rowDetail = new SlickRowDetailView(pubSubService as EventPubSubService);
return [{ name: ExtensionName.rowDetailView, instance: rowDetail }];
},
rowDetailView: {
// ...
// ViewComponent Template to load when row detail data is ready
Expand Down

0 comments on commit 0037684

Please sign in to comment.