Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #104101
    Guillermo Rubio
    Participant

    Hello,

    My clients needs to horizontal scroll to see the end of a task, but when there’s many task, they havo to go all the way down scroll where they think is the end of the task and go up to the task, and repeat if not showing the end.

    Is there a way to click outside a task and move/drag the whole gantt, or anything i can use to prevent this problem?

    Thank you

    #104110

    Hi,

    Could you please, explain further the problem as I did not understand it.
    The horizontal and the vertical scrollbars are independent, I do not understand why are you scrolling this way.
    Are you using some auto-height?

    You can also send us a demo here or to support@jqwidgets.com

    We are waiting for your reply!

    Best Regards,
    Svetoslav Borislavov

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

    #104115
    Guillermo Rubio
    Participant

    Hello ill try to explain better:

    Lets say i want to see where the orange bar ends:

    (https://ibb.co/NLnPLDD)

    So i need to scroll to the right, but i have many task so i have to go down all the way to find the horizontal scroll bar

    (https://ibb.co/g3N8vD9)

    scroll to the right

    (https://ibb.co/DKN3TC5)

    and go up again to see if i see the end of the orange bar (in this case i dont so ill have to do it again)

    (https://ibb.co/HhZ4JJc)

    #104118

    Hi,

    What styles are you applying, because this horizontal scroll is not the same as our default?
    As you can see in this demo with many tasks: https://www.htmlelements.com/react/demos/gantt/many-tasks/

    The horizontal scroll is under the tasks and also under the table.

    You can also send us a demo here or to support@jqwidets.com

    Best Regards,
    Svetoslav Borislavov

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

    #104140
    Guillermo Rubio
    Participant

    Hi, i was using

    .smart-gantt-chart {
    height: fit-conten
    }

    but anyway i changed it and it solved more or less the problem, i also figured out how to do what i wanted (click and drag to the left/right the gantt) ill let u the code here in case u need it:

    in useEffect:

    const gantt = document.getElementsByClassName(‘smart-timeline-content’)[0]
    if (gantt) {

    gantt.addEventListener(‘mousedown’, (e) => {
    document.body.style.cursor = ‘grabbing’
    document.addEventListener(‘mousemove’, mouseMoveHandler)
    document.addEventListener(‘mouseup’, mouseUpHandler)
    }
    }

     

     

    functions definition:

    const mouseMoveHandler = function (e: MouseEvent) {
    if (!dateRef.current) {//dateRef is a useref that changes when the gantt event onResizeStart and comes back to null onResizeEnd, this way i prevent scrolling when resizing
    if (xRef.current == null) xRef.current = e.pageX //xRef is a useRef to store last pageX
    if (xRef.current != e.pageX) {
    const scrollbar = document.querySelectorAll(
    ‘[smart-id=”horizontalScrollBar”]’
    )[1]
    const currentScroll = parseInt(scrollbar.getAttribute(‘value’)) || 0
    const max = parseInt(scrollbar.getAttribute(‘max’))
    let diff = (xRef.current – e.pageX) * (max / 700) //increase decrease 700 to make it slower/faster
    if (diff > 0) diff = Math.ceil(diff)
    else diff = Math.floor(diff)
    if (diff != 0) {
    const scroll =
    currentScroll + diff < 0
    ? 0
    : currentScroll + diff > max
    ? max
    : currentScroll + diff
    scrollbar.setAttribute(‘value’, scroll.toString())
    scrollRef.current = scroll.toString()
    }
    xRef.current = e.pageX
    }
    }
    }
    const mouseUpHandler = function (e) {
    document.body.style.cursor = ”
    document.removeEventListener(‘mousemove’, mouseMoveHandler)
    document.removeEventListener(‘mouseup’, mouseUpHandler)
    xRef.current = null
    }

    I think it would be a nice add on the gantt

    I have another problem now but ill put it in another ticket as i think is different
    Thank u very much

    #104144

    Hi,

    I suggest you send a demo to us here: support@jqwidgets.com
    This is not a good workaround. I have tried to reproduce the problem, but I couldn’t

    We are waiting for you!

    Best Regards,
    Svetoslav Borislavov

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

    #104147

    Hi,

    Another problem may be the height: fit-content

    It should be a number or percentage

    Best Regards,
    Svetoslav Borislavov

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

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