scrollTo() specific row in the next pagination

scrollTo() specific row in the next pagination

edosedos Posts: 6Questions: 1Answers: 0

i'm already implement the scroller for datatable and want to use scrollTo function
the pagelengthdisplay is 63 and when i do table.row(70).scrollTo(), it can't be done
the function tell that no index was found in the page

when i do table.row(60).scrollTo() it work nicely

how can i make that table.row(70).scrollTo() to work, any solution for this problem
thank you,
edos

Answers

  • edosedos Posts: 6Questions: 1Answers: 0

    what am i going to do is

    i'm using server side processing
    then update specific row (index = 40)
    after update, that row will be go to index 70
    and after update row complete, i'm using ajax.reload(null,false) to reload the table, coz there is value that empty being filled
    so i need to use table.row(70).scrollTo(), but it cant be done

    any solution for this problem
    thank you,
    edos

  • edosedos Posts: 6Questions: 1Answers: 0

    https://jsfiddle.net/edos/52gk5w4q/19/

    i already upload some test, of course it bugged
    please look on update() function on jsfiddle, you can look i'm commenting something
    thank you,
    edos

  • kthorngrenkthorngren Posts: 21,260Questions: 26Answers: 4,934

    It doesn't look like your server side response is complete. I don't see the draw, recordsTotal and recordsFiltered return parameters as described here:
    https://datatables.net/manual/server-side#Returned-data

    Not returning that info may affect the scroller's ability to request more information from the server.

    Kevin

  • edosedos Posts: 6Questions: 1Answers: 0
    edited February 2017

    i'm also get to test with client side data for comparison with my server side code

    https://jsfiddle.net/edos/kss4vxLv/3/

    please look on update() function, i commenting on that function same as my previous jsfiddle

    the problem still the same, i need to scroll to certain index after updating 1 row

    thank you,
    edos

  • edosedos Posts: 6Questions: 1Answers: 0
    edited February 2017

    ah sorry i messed up editing my comment, suddenly replaced

    oh sorry, i miss that part of parameter, i'd update it

    https://jsfiddle.net/edos/52gk5w4q/23/

    1. what i do is, datatable request data with parameter start and length to my server -> my server give 63 data to the view.
    2. from that 63 data, i editing 1 data that have tgl.terima is null via ajax call
    3. ajax will edit my data, then server will give 63 data again to the view
    4. my edited is not in 63 data that my server give, but in index 73
    5. so i need to do table.row(73).scrollTo() so datatable will scroll to that index
    6. but it stuck, not scrolled at all

    any solution?

    thank you,
    edos

  • edosedos Posts: 6Questions: 1Answers: 0

    i get the solution

    after exploring the scroller documentation, use scrollToRow() function can solve my problem

    thank you,
    edos

This discussion has been closed.