Skip to content

Commit 4eb9237

Browse files
authored
fix(core): don't override alwaysShowVerticalScroll flag (#600)
fix(core): don't override alwaysShowVerticalScroll flag - the `alwaysShowVerticalScroll` flag should be dealt directly in the core and it should never show vertical scroll on left frozen container, even when the `alwaysShowVerticalScroll` is set to True (see core lib [PR #537](6pac/SlickGrid#537)) - requires core lib [PR #537](6pac/SlickGrid#537) to be merged and released
1 parent 6a68e23 commit 4eb9237

8 files changed

+13
-16
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"lodash.isequal": "^4.5.0",
110110
"moment-mini": "^2.24.0",
111111
"rxjs": "^6.3.3",
112-
"slickgrid": "^2.4.29",
112+
"slickgrid": "^2.4.30",
113113
"text-encoding-utf-8": "^1.0.2"
114114
},
115115
"peerDependencies": {

src/app/examples/grid-colspan.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export class GridColspanComponent implements OnInit {
7878
];
7979

8080
this.gridOptions2 = {
81-
alwaysShowVerticalScroll: false, // disable scroll since we don't want it to show on the left pinned columns
8281
enableCellNavigation: true,
8382
enableColumnReorder: false,
8483
createPreHeaderPanel: true,
@@ -112,7 +111,7 @@ export class GridColspanComponent implements OnInit {
112111
}
113112

114113
setFrozenColumns2(frozenCols: number) {
115-
this.gridObj2.setOptions({ frozenColumn: frozenCols, alwaysShowVerticalScroll: false });
114+
this.gridObj2.setOptions({ frozenColumn: frozenCols });
116115
this.gridOptions2 = this.gridObj2.getOptions();
117116
}
118117

src/app/examples/grid-frozen.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ export class GridFrozenComponent implements OnInit {
200200
containerId: 'demo-container',
201201
sidePadding: 10
202202
},
203-
alwaysShowVerticalScroll: false, // disable scroll since we don't want it to show on the left pinned columns
204203
enableExcelCopyBuffer: true,
205204
enableCellNavigation: true,
206205
editable: true,
@@ -276,7 +275,7 @@ export class GridFrozenComponent implements OnInit {
276275
}
277276

278277
setFrozenColumns(frozenCols: number) {
279-
this.gridObj.setOptions({ frozenColumn: frozenCols, alwaysShowVerticalScroll: false });
278+
this.gridObj.setOptions({ frozenColumn: frozenCols });
280279
this.gridOptions = this.gridObj.getOptions();
281280
}
282281

src/app/examples/grid-graphql-nopage.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ export interface Country {
4040
export class GridGraphqlWithoutPaginationComponent implements OnInit {
4141
title = 'Example 27: GraphQL Basic API without Pagination';
4242
subTitle = `
43-
Use it as a basic GraphQL API with any external public APIs (<a href="/ghiscoding/Angular-Slickgrid/wiki/GraphQL" target="_blank">Wiki docs</a>).
43+
Use basic GraphQL query with any external public APIs (<a href="/ghiscoding/Angular-Slickgrid/wiki/GraphQL" target="_blank">Wiki docs</a>).
4444
<ul>
4545
<li>This Examples uses a Public GraphQL API that you can find at this link <a href="https://countries.trevorblades.com/" target="_blank">https://countries.trevorblades.com/</a></li>
46-
<li>Compare to the regular and default GraphQL implementation, you will find the following differenecs</li>
46+
<li>Compare to the regular and default GraphQL implementation, you will find the following differences</li>
4747
<ul>
48-
<li>There are no Pagination and we only use GraphQL once to load the data</li>
48+
<li>There are no Pagination and we only use GraphQL <b>once</b> to load the data, then we use the grid as a regular local in-memory grid</li>
4949
<li>We enabled the following 2 flags "useLocalFiltering" and "useLocalSorting" to use regular (in memory) DataView filtering/sorting</li>
5050
</ul>
51-
<li>NOTE - This Example calls multiple GraphQL queries, this is ONLY for demo purposes, you would typically only call 1 query (which is what GraphQL is good at)</li>
52-
<li>This demo is mainly to show the use of GraphqlService to build the query and retrieve the data but also to show how to mix that with usage of local Filtering/Sorting strategies</li>
51+
<li>NOTE - This Example calls multiple GraphQL queries, this is <b>ONLY</b> for demo purposes, you would typically only call 1 query (which is what GraphQL is good at)</li>
52+
<li>This example is mainly to demo the use of GraphqlService to build the query and retrieve the data but also to demo how to mix that with local (in-memory) Filtering/Sorting strategies</li>
5353
</ul>
5454
`;
5555
angularGrid: AngularGridInstance;

src/app/modules/angular-slickgrid/extensions/__tests__/gridMenuExtension.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ describe('gridMenuExtension', () => {
607607

608608
expect(onCommandSpy).toHaveBeenCalled();
609609
expect(setColumnsSpy).toHaveBeenCalled();
610-
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: -1, alwaysShowVerticalScroll: true });
610+
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: -1 });
611611
});
612612

613613
it('should call "clearFilters" and dataview refresh when the command triggered is "clear-filter"', () => {

src/app/modules/angular-slickgrid/extensions/__tests__/headerMenuExtension.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ describe('headerMenuExtension', () => {
416416
instance.onCommand.notify({ column: columnsMock[0], grid: gridStub, command: 'freeze-columns' }, new Slick.EventData(), gridStub);
417417

418418
expect(onCommandSpy).toHaveBeenCalled();
419-
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: 0, alwaysShowVerticalScroll: false });
419+
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: 0 });
420420
expect(setColumnsSpy).toHaveBeenCalled();
421421
});
422422

@@ -429,7 +429,7 @@ describe('headerMenuExtension', () => {
429429
instance.onCommand.notify({ column: columnsMock[1], grid: gridStub, command: 'freeze-columns' }, new Slick.EventData(), gridStub);
430430

431431
expect(onCommandSpy).toHaveBeenCalled();
432-
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: -1, alwaysShowVerticalScroll: false });
432+
expect(setOptionsSpy).toHaveBeenCalledWith({ frozenColumn: -1 });
433433
expect(setColumnsSpy).toHaveBeenCalled();
434434
});
435435

src/app/modules/angular-slickgrid/extensions/gridMenuExtension.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ export class GridMenuExtension implements Extension {
370370
switch (args.command) {
371371
case 'clear-frozen-columns':
372372
const visibleColumns = [...this.sharedService.visibleColumns];
373-
const showVerticalScroll = this.sharedService.gridOptions && this.sharedService.gridOptions.enableGridMenu || false;
374-
this.sharedService.grid.setOptions({ frozenColumn: -1, alwaysShowVerticalScroll: showVerticalScroll });
373+
this.sharedService.grid.setOptions({ frozenColumn: -1 });
375374
if (Array.isArray(visibleColumns) && Array.isArray(this.sharedService.allColumns) && visibleColumns.length !== this.sharedService.allColumns.length) {
376375
this.sharedService.grid.setColumns(visibleColumns);
377376
}

src/app/modules/angular-slickgrid/extensions/headerMenuExtension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class HeaderMenuExtension implements Extension {
329329
case 'freeze-columns':
330330
const visibleColumns = [...this.sharedService.visibleColumns];
331331
const columnPosition = visibleColumns.findIndex((col) => col.id === args.column.id);
332-
this.sharedService.grid.setOptions({ frozenColumn: columnPosition, alwaysShowVerticalScroll: false });
332+
this.sharedService.grid.setOptions({ frozenColumn: columnPosition } as GridOption);
333333

334334
// to freeze columns, we need to take only the visible columns and we also need to use setColumns() when some of them are hidden
335335
// to make sure that we only use the visible columns, not doing this would show back some of the hidden columns

0 commit comments

Comments
 (0)