Code Monkey home page Code Monkey logo

Comments (14)

romgrk avatar romgrk commented on July 3, 2024

Column virtualization already exists by default. Can you share a minimal reproduction test case with the latest version. This would help a lot 👷.
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

from mui-x.

netouson avatar netouson commented on July 3, 2024

https://codesandbox.io/s/wizardly-solomon-c9nnyx?file=/demo.tsx
Here is a reproduction of the issue

from mui-x.

romgrk avatar romgrk commented on July 3, 2024

You can use useGridApiEventHandler(apiRef, 'scrollPositionChange', (params, event) => { ... }) to react to scroll events, and you can use apiRef.current.virtualScrollerRef.current to access the grid DOM node with scrollbars. Don't try to wrap the grid with custom scrollbars.

https://mui.com/x/react-data-grid/events/#with-usegridapieventhandler

from mui-x.

netouson avatar netouson commented on July 3, 2024

Is this the only way?
how can we optimize it so it wont show lag when scrolling and it would feel more seamless?
Thanks

from mui-x.

romgrk avatar romgrk commented on July 3, 2024

You can add a vanilla javascript handler attached to the apiRef.current.virtualScrollerRef element that listens to scroll events, and reflects it to the other grid. You will need to ensure that programatically scrolling one doesn't trigger the other one's scroll event, to avoid the scroll behaving weirdly (if it gets semi-locked, not scrolling for more than a few pixels, it means you're hitting this case).

Be sure to free the resources and detach the event listeners when your components are unmounted.

from mui-x.

netouson avatar netouson commented on July 3, 2024

Thank you very much!
will give it a try

from mui-x.

netouson avatar netouson commented on July 3, 2024

Im having a problem when forwarding the ref to the datagridpremium -
could you please write a small example on how to sync-
const apiRefData = useGridApiRef() with a forwardRef?
Thank you!

from mui-x.

netouson avatar netouson commented on July 3, 2024

Im having a problem when forwarding the ref to the datagridpremium -
could you please write a small example on how to sync-
const apiRefData = useGridApiRef() with a forwardRef?
Thank you!

from mui-x.

romgrk avatar romgrk commented on July 3, 2024

Please provide a minimal reproduction test case with the latest version. This would help a lot 👷.
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

from mui-x.

netouson avatar netouson commented on July 3, 2024

https://codesandbox.io/s/loving-vaughan-wg84tf?file=/demo.tsx
basically when scrolling the position left is always on 0 and not propagating.

from mui-x.

romgrk avatar romgrk commented on July 3, 2024

The link you shared does not run. Please provide a minimally working link.

image

from mui-x.

netouson avatar netouson commented on July 3, 2024

https://codesandbox.io/s/lucid-pateu-tm6n6z?file=/demo.tsx
sorry!
from what I can see on my end- on the top element that forwards the ref
the current.scrollLeft is always 0 and cant be set. maybe Im not accessing it correctly?

from mui-x.

romgrk avatar romgrk commented on July 3, 2024

The horizontal scroll sync is working in that link for me. Could you clarify what is not working for you? Make sure to include good reproduction steps.

from mui-x.

github-actions avatar github-actions commented on July 3, 2024

The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.