Scroller extension with back/next buttons

Scroller extension with back/next buttons

mr.shahinmr.shahin Posts: 10Questions: 2Answers: 1

Hi every one,
I'm using Datatables Editor With the Scroller extension as below example:
https://datatables.net/extensions/scroller/examples/initialisation/server-side_processing.html
And trying to add the back/next functionality to the Editor like below example:
https://editor.datatables.net/examples/api/backNext.html
But I get stuck as every time I try to do it, I get strange behavior and Datatables do unexpected scrolls.
Anyone can provide a good working example of this??
Thanks in advance,
Regards

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @mr.shahin ,

    That sounds odd - but hard to diagnose without seeing it. We're happy to take a look, 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

  • mr.shahinmr.shahin Posts: 10Questions: 2Answers: 1
    edited March 2019

    Hi @colin ,
    Thanks for your response.
    Here's the issue reproduced:
    https://jsbin.com/josaxaj/edit?html,js,output
    All I need to select an entry and then auto scroll with the editor to load more data without the unexpected scrolling behavior.
    Also, keep entry selected after rendering the table when saving data.
    Thanks in advance,
    Regards,
    Shahin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @mr.shahin ,

    That test case isn't running - can you provide a test case that demonstrates the problem, please.

    Cheers,

    Colin

  • mr.shahinmr.shahin Posts: 10Questions: 2Answers: 1
    edited March 2019

    It's running, But please add Datatables Editor extension script as per my comment there as it'll not work If I added it straight forward from your website.

  • allanallan Posts: 63,480Questions: 1Answers: 10,467 Site admin

    Its the async behaviour of server-side processing that is causing the issue here. If you disable serverSide it works as expected. I'm not yet sure how to address this in the custom buttons. How many rows are in your table?

    Allan

  • mr.shahinmr.shahin Posts: 10Questions: 2Answers: 1

    Hi @allan ,
    Unfortunately, I can't disable server-side processing as we have to render lots of data from different tables that are being joined, so I 've to render the data into chunks to not overload the server.
    So what do you think is the best options to have this combination ( Editor with back/next + server-side processing + maintain the scrolling position/selection after saving and table redraw)?
    Thanks in advance,
    Shahin

  • allanallan Posts: 63,480Questions: 1Answers: 10,467 Site admin

    Hi Shahin,

    I haven't tried it yet, but I think what you'll need to do is wait for the server-side processing response after the submit - so you could try:

    action: function (e) {
        table.one('draw', function () {
            if (table.row(.... )
            ...
        } );
        this.submit();
    }
    

    Allan

This discussion has been closed.