Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, this should be possible. I made small TablePress Extension out of this. To use that, please download https://pastebin.com/raw/tJLxD2XZ and save it as a new plugin on your site, in the folder
    /wp-content/plugins/tablepress-datatables-pagination-scrolltotop/tablepress-datatables-pagination-scrolltotop.php

    After that, activate the new plugin “TablePress Extension: DataTables Pagination ScrollToTop” on your site. Then, to use this with your tables, add an extra parameter to the Shortcode on the page where you are showing the table, like

    [table id=123 datatables_pagination_scrolltotop=true /]
    

    Regards,
    Tobias

    Thread Starter sumonty1923

    (@sumonty1923)

    Thank you very much for your efforts with this. I have followed your directions but I am not getting the scroll to top interaction. See here: https://endless-jungle.jurassic.ninja/table-to-top-test/

    Thanks, 🙂

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, my bad. Please delete line 16

    add_filter( 'tablepress_datatables_parameters', 'tablepress_add_pagination_scrolltotop_js_parameter', 10, 4 );
    

    from the file.
    Then, please also change the line (near the end)

    $( document ).scrollTop( $( table.table().container() ).offset().top );
    

    to

    $( document ).scrollTop( $( {$name}.table().container() ).offset().top );
    

    Regards,
    Tobias

    Thread Starter sumonty1923

    (@sumonty1923)

    Amazing! Thank you very much. This works great! 🙂

    Thank you!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias
     
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Scroll To Top’ is closed to new replies.