Scroll page when reordering row

Scroll page when reordering row

WahidNWahidN Posts: 4Questions: 2Answers: 0

I've noticed that the old datatable scrolls the page (body or html!) when you was reordering the row and you was at the bottom of the page. The new one however does not and you need to scroll manually. Is there an option to activate scrolling the page when dragging?

NOTE: I know it works when you have scrollY active but I dont want the table to have an overflow-scroll

Answers

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    Hi @wahidn ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • WahidNWahidN Posts: 4Questions: 2Answers: 0

    Hi @colin,

    Here is a test case: http://live.datatables.net/kajilelu/1/edit

    When you reorder a row (click and drag) and reach the bottom, the page doesnt automatically scroll down and you have to scroll manually

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    Hi @WahidN ,

    Thanks for that, I went back about 5 years to earlier versions, see here, and the behaviour was the same. When do you think it stopped scrolling?

    Cheers,

    Colin

  • maeser@gmail.commaeser@gmail.com Posts: 5Questions: 1Answers: 0

    Although I don't dispute whether this was working differently in an earlier version, is there a means to be able to accomplish what @WahidN is calling out?

    I have the same question/concern. Typically the browser will scroll if you have the mouse depressed and you move to the edge of the browser window and there is more content. However in this scenario, if I have records that continue off the page out of the visible area of the browser, I click and drag a row to reorder it to the a position out of view the page, the the browser will not auto scroll. I can use the mouse wheel to scroll the page up and down and continue with the row reorder placement. However, the default functionality of auto scrolling when dragging a mouse click in the browser does not respond when initiated in the datatable.

    scrollY option is available but not a solution I'm looking for.

    Thanks,
    -Mike

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    There is actually code in RowReorder to handle this, but it doesn't appear to be working for some reason. I've filed a bug for this and we'll get it fixed and post back when its understood.

    Allan

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    For my reference, that raised bug is DD-1305.

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    @maeser@gmail.com @WahidN Just to let you know this has been addressed - see here with the nightly builds. We're aiming to release it in the next couple of weeks.

    Colin

  • ivodvorakivodvorak Posts: 1Questions: 0Answers: 0

    Hi, this still doesn't work on mobile phones.
    Tested on Android - Chrome, Edge, Firefox,
    with @colin example:
    http://live.datatables.net/lujamahu/1/edit

    Thanks for your great job with DataTables !

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    The live site never really works all that well on mobiles. Try this page which is working for me okay on Android.

    Allan

Sign In or Register to comment.