JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Gantt Gantt: save and utilize scroll positions

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #109004
    Shubham Printe
    Participant

    Hi,
    I am using react functional components to render smart-gantt-chart. I am feeding a list of tasks to the Gantt chart after fetching it from a back-end server.
    There are a lot of tasks and the date range is also huge, so there are both horizontal and vertical scroll bars present. At each instance where the user creates a connection between two tasks, I save that information and fetch a new set of tasks back from the server.

    The problem that I am facing is that whenever I complete this process, the Gantt chart’s scroll position resets back to (0, 0).

    How can I save the scroll positions (x, y), so that when I fetch the fresh list of tasks, the user is able to be exactly where he/she was?

    I have tried using ‘gantt.loadState()’ function to specify scroll positions for the gantt-chart but that only sets the horizontal scroll, not the vertical one.

    #109005
    Markov
    Keymaster

    Hi,

    We will add API to get/set the scroll position in the next version of the Gantt. At present, we do not have API for that available out of the box.

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #109636

    Team, Is this feature live now?

    #109638
    Markov
    Keymaster

    Hi,

    Yes, you can use scrollTop and scrollLeft properties of the gantt chart.

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #109644

    @markov thanks for the response, can you please provide the documentation for scrollTop API?

     

    #109661
    Markov
    Keymaster

    It is basically gantt.scrollTop or gantt.scrollLeft. Reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.