Skip to content

Commit

Permalink
fix(Pagination): the Pagination wasn't showing when using dataset setter
Browse files Browse the repository at this point in the history
- the Pagination should work in 2 use cases (1. when dataset is provided through the constructor, 2. when dataset is provided through its setter) and the previous PR #396 broke the use case 1. This PR fixes it and now it works in both use cases.
  • Loading branch information
ghiscoding committed Jul 6, 2021
1 parent 6062f0f commit ac3f933
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Slickgrid-Universal has **100%** Unit Test Coverage, we are talking about +13,00
| [@slickgrid-universal/text-export](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/text-export) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/text-export.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/text-export) | Export to Text File Service (csv/txt) | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/text-export/CHANGELOG.md) |
| [@slickgrid-universal/graphql](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/graphql) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/graphql.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/graphql) | GraphQL Query Service (support Filter/Sort/Pagination) | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/graphql/CHANGELOG.md) |
| [@slickgrid-universal/odata](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/odata) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/odata.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/odata) | OData Query Service (support Filter/Sort/Pagination) | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/odata/CHANGELOG.md) |
| [@slickgrid-universal/pagination-component](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/pagination-component) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/pagination-component.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/pagination-component) | Simple Pagination Component | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/pagination-component/CHANGELOG.md) |
| [@slickgrid-universal/rxjs-observable](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/rxjs-observable) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/rxjs-observable.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/rxjs-observable) | RxJS Observable Service Wrapper | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/rxjs-observable/CHANGELOG.md) |
| [@slickgrid-universal/vanilla-bundle](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/vanilla-bundle) | [![npm](https://img.shields.io/npm/v/@slickgrid-universal/vanilla-bundle.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/vanilla-bundle) | Vanilla TypeScript/ES6 implementation | [changelog](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/vanilla-bundle/CHANGELOG.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export class Example12 {
this.dataset = this.loadData(500);
this.gridContainerElm = document.querySelector<HTMLDivElement>(`.grid12`);

this.sgb = new Slicker.GridBundle(this.gridContainerElm, this.columnDefinitions, { ...ExampleGridOptions, ...this.gridOptions }, this.dataset);
this.sgb = new Slicker.GridBundle(this.gridContainerElm, this.columnDefinitions, { ...ExampleGridOptions, ...this.gridOptions });
this.sgb.dataset = this.dataset;
// this.sgb.slickGrid.setActiveCell(0, 0);

// bind any of the grid events
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,6 @@ export class SlickVanillaGridBundle {

// also initialize (render) the pagination component
this.renderPagination();

this._isPaginationInitialized = true;
}
}

Expand All @@ -1198,7 +1196,8 @@ export class SlickVanillaGridBundle {
if (this._gridOptions.enablePagination && !this._isPaginationInitialized && showPagination) {
this.slickPagination = new SlickPaginationComponent(this.paginationService, this._eventPubSubService, this.sharedService, this.translaterService);
this.slickPagination.renderPagination(this._gridParentContainerElm);
} else {
this._isPaginationInitialized = true;
} else if (!showPagination) {
if (this.slickPagination) {
this.slickPagination.dispose();
}
Expand Down

0 comments on commit ac3f933

Please sign in to comment.