You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pinning): recalculate frozen idx properly when column shown changes (#682)
- when using ColumnPicker, GridMenu or hiding a column via HeaderMenu, it has to recalculate the frozenColumn index because SlickGrid doesn't take care of that and the previous fix that I implement sometimes become out of sync. This PR simplifies the frozenColumn index position, it will simply update it when the index is different, as simple as that.
it('should increase "frozenColumn" from 0 to 1 when showing a column that was previously hidden and its index is lower or equal to provided argument (2nd arg, frozenColumnIndex)',()=>{
159
+
it('should increase "frozenColumn" from 0 to 1 when showing a column that was previously hidden and its index is lower or equal to provided argument of frozenColumnIndex',()=>{
it('should keep "frozenColumn" at 0 when showing a column that was previously hidden and its index is greater than provided argument (2nd arg, frozenColumnIndex)',()=>{
it('should keep "frozenColumn" at 1 when showing a column that was previously hidden and its index is greater than provided argument of frozenColumnIndex',()=>{
it('should decrease "frozenColumn" from 1 to 0 when hiding a column that was previously shown and its index is lower or equal to provided argument (2nd arg, frozenColumnIndex)',()=>{
179
+
it('should decrease "frozenColumn" from 1 to 0 when hiding a column that was previously shown and its index is lower or equal to provided argument of frozenColumnIndex',()=>{
it('should keep "frozenColumn" at 1 when hiding a column that was previously hidden and its index is greater than provided argument (2nd arg, frozenColumnIndex)',()=>{
189
+
it('should keep "frozenColumn" at 1 when hiding a column that was previously hidden and its index is greater than provided argument of frozenColumnIndex',()=>{
Copy file name to clipboardExpand all lines: src/app/modules/angular-slickgrid/extensions/extensionUtility.ts
+5-18
Original file line number
Diff line number
Diff line change
@@ -75,28 +75,15 @@ export class ExtensionUtility {
75
75
* When using ColumnPicker/GridMenu to show/hide a column, we potentially need to readjust the grid option "frozenColumn" index.
76
76
* That is because SlickGrid freezes by column index and it has no knowledge of the columns themselves and won't change the index, we need to do that ourselves whenever necessary.
77
77
* Note: we call this method right after the visibleColumns array got updated, it won't work properly if we call it before the setting the visibleColumns.
78
-
* @param {String} pickerColumnId - what is the column id triggered by the picker
79
78
* @param {Number} frozenColumnIndex - current frozenColumn index
80
-
* @param {Boolean} showingColumn - is the column being shown or hidden?
81
79
* @param {Array<Object>} allColumns - all columns (including hidden ones)
0 commit comments