Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree scrolls and flickers on frequent update on tree data #1201

Closed
3 tasks done
kiranbangar5946 opened this issue Jul 18, 2023 · 4 comments
Closed
3 tasks done

Tree scrolls and flickers on frequent update on tree data #1201

kiranbangar5946 opened this issue Jul 18, 2023 · 4 comments

Comments

@kiranbangar5946
Copy link

Clear and concise description of the problem

We have tree with 3 levels, it work great.Thanks. But when at level 3 there are multiple updates the ui flickers and if user wants to see it scrolling , unable to scroll as scroll moved up and down due to updates. Please suggest and help.

Suggested solution

Child fluctuation stops.

Alternative

No response

Additional context

No response

Validations

@ghiscoding
Copy link
Owner

unless you provide a full way to reproduce I cannot help

@kiranbangar5946
Copy link
Author

  1. Create 3 levels in tree. a. Grandparent b. parent c. child
  2. Insert atleast 50-100 childs after every second or less for that heirarchy.
  3. We will observe , if user wants to scroll and see the data added at bottom .It wont allow to navigate bottom ,as scroll moves to top every time a new child is inserted. I guess on new row insert scroll is forced to move to top.Which makes it difficult to see child added which is at bottom .
    Only way to see the child added are once all the childs are inserted and dom is no more manipulated.

Thanks in advance.

ghiscoding added a commit to ghiscoding/slickgrid-universal that referenced this issue Jul 19, 2023
- we should be able to disable the scroll into view if we don't want it
- also fixes an issue when inserting multiple items in a Tree Data grid, the previous default was to use the insert position to then scroll to top/bottom of the grid, however in a Tree Data grid it does not necessarily insert at the top/bottom it would rather insert the item in a defined group which could end up being in the middle of the grid so we shouldn't automatically
- fixes an issue opened in Angular-Slickgrid, ghiscoding/Angular-Slickgrid#1201
ghiscoding added a commit to ghiscoding/slickgrid-universal that referenced this issue Jul 19, 2023
…#1043)

* feat(common): add optional `scrollIntoView` to GridService `addItems`
- we should be able to disable the scroll into view if we don't want it
- also fixes an issue when inserting multiple items in a Tree Data grid, the previous default was to use the insert position to then scroll to top/bottom of the grid, however in a Tree Data grid it does not necessarily insert at the top/bottom it would rather insert the item in a defined group which could end up being in the middle of the grid so we shouldn't automatically
- fixes an issue opened in Angular-Slickgrid, ghiscoding/Angular-Slickgrid#1201
ghiscoding added a commit that referenced this issue Jul 21, 2023
…d-position

feat(common): add `scrollIntoView` to GridService `addItems`, fix #1201
@ghiscoding
Copy link
Owner

ghiscoding commented Jul 21, 2023

I assume you were using the GridService addItems, the default behavior of that method was to scroll top by default (which was dependent to the position option). I removed the default position scrolling and also added scrollRowIntoView option to addItem(s), this new option is true by default and will scroll to the inserted item instead of scrolling to top or bottom, you could also disable that new option and if you do then it will insert in the grid but without scrolling anywhere

Please note that you might still see flickering for a very short period, the reason is because SlickGrid by itself doesn't support Tree Data, the way I made it working in Slickgrid-Universal was to create a flat dataset (which SlickGrid requires) from a Tree Data, and for that to work it requires to rebuild the tree data and the flat data every time we change the dataset, that is also true when adding/removing a new item to the dataset. However it is so fast that it's barely noticeable

So the fix was released under v6.1.0
Cheers ⭐

@ghiscoding
Copy link
Owner

ghiscoding commented Aug 21, 2023

I'm not sure if the problem was occurring with a Tree Data Parent/Child or a Hierarchical Tree since you did not provide much feedback, but a fix was also pushed to fix an issue that was scrolling back to top when inserting a new item. In summary, a scrolling to top for Tree Parent/Child was fixed in v6.1.0 and similar problem was fixed for Tree Data Hierarchical in v6.2.0

You can test item insert in both examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants