Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Horizontal scrolling in igx-grid is broken (issue #2)

We have encountered a second, very significant problem with horizontal scrolling in igx-grid:

If the grid is scrolled all the way to the right and the existing set of columns is replaced, the grid will be irretrievably broken.

We have a grid that has the potential to have a very large number of columns. In order to make this manageable for our users, we allow them to save different sets of columns in views that they can switch between.

Because the users can move columns to different positions, we can just use a single set of columns and update them when the user wants to change the view.

The problem that we stumbled into is when the grid was scrolled all the way to the right and the new set of columns was loaded, an exception similar to the following was thrown:

Cannot read properties of undefined (reading 'context')
    at IgxGridForOfDirective._updateViews (webpack://ps/node_modules/@infragistics/igniteui-angular/fesm2022/infragistics-igniteui-angular.mjs:16000:0)
    at IgxGridForOfDirective._applyChanges (webpack://ps/node_modules/@infragistics/igniteui-angular/fesm2022/infragistics-igniteui-angular.mjs:16011:0)
    at IgxGridForOfDirective.ngDoCheck (webpack://ps/node_modules/@infragistics/igniteui-angular/fesm2022/infragistics-igniteui-angular.mjs:15818:0)

Once this exception was thrown, the user could no longer use the grid until they reloaded the page and, in some cases, the grid code or angular went into an infinite loop.

We were able to work around by asking the grid's navigation service to scroll to the first visible, non-frozen cell. We then had to issue a window.timeout to perform the column changing.

This, to us, seems like a fairly fundamental problem in the scrolling code that we probably shouldn't have to have a window.settimeout workaround for.