• Resolved 825mjolen

    (@825mjolen)


    I have noticed that the horizontal slider seems to stop working after I updated my site. I then need to turn off the horizontal slider and then turn it back on again. Has anyone run into this issue before?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Hi Tobias,

    Same issue for me, for example here: https://www.sunsetbld.com/visiter-usa/parcs-sites-naturels-americains/antelope-canyon/#climat

    If I tick the line “Enable horizontal scrolling…”, it’s OK, but I have to do this on 251 tables! Unless it is possible to do so one time, but how? Via database?

    Thanks for your help

    Jean-Christophe

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi @sunsetbld,

    in your case, it sounds as if the Horizontal Scrolling feature was not activated previously, right? And now you are looking for a way to enable it for all tables? For that, please add this to the “functions.php” file of your theme:

    add_filter( 'tablepress_table_render_options', 'sunsetbld_tablepress_responsive_scroll', 10, 2 );
    function sunsetbld_tablepress_responsive_scroll( $render_options, $table ) {
      $render_options['datatables_scrollx'] = true;
      return $render_options;
    }

    I think, 825mjolen’s problem is that the feature was activated but did not work, but then work again after turning it off and on again (which would also be strange).

    Regards,
    Tobias

    Many thanks Tobias, I really appreciate!

    Just a little question: should I keep this code permanently in the functions file, or can I delete it after enabling the horizontal scrolling?

    Thanks again ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    this particular code would need to remain there permanently. It essentially overwrites the value of the checkbox from the “Edit” screen.

    Regards,
    Tobias

    Ok Tobias… but unfortunatly, the code does not work…

    Regards

    Jean-Christophe

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    can you give me a link where it’s not working?

    Regards,
    Tobias

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks! It appears that this table does not have the “Enable visitor features” checkbox checked on its “Edit” screen, correct?

    That would be required for the horizontal scrolling to work. Now, this can also be done in the same way with that piece of code, but when doing that, it will likely directly enable sorting, filtering, and pagination for this table. These can then likewise be turned off again, but this would again affect all tables on the site. So, if you want all tables on the site to only have horizontal scrolling, but not the other features, this should do it:

    add_filter( 'tablepress_table_render_options', 'sunsetbld_tablepress_responsive_scroll', 10, 2 );
    function sunsetbld_tablepress_responsive_scroll( $render_options, $table ) {
      $render_options['use_datatables'] = true;
      $render_options['datatables_sort'] = false;
      $render_options['datatables_filter'] = false;
      $render_options['datatables_paginate'] = false;
      $render_options['datatables_info'] = false;
      $render_options['datatables_scrollx'] = true;
      return $render_options;
    }

    Regards,
    Tobias

    Thread Starter 825mjolen

    (@825mjolen)

    @tobiasbg,

    Sorry for the delayed response. I unfortunately do not have a public page to share with you as I am using the table on a password protected page. Any other ideas on how I might be able to show you what you may need to look at. Just had to reference something on that table this morning and noticed that the horizontal scroll was not working again. My fix is to unselect the scroller, save, select the scroller, save again. And then it seems to work. Not sure why it’s losing that ability. My only thought is that an update takes place which resets the setting some how.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    what exact horizontal scroller do you mean here? Can you maybe take a screenshot of that (you can create one by pressing “Print” on the keyboard on Windows, or Cmd+Shift+3 on a Mac, and then upload it to a service like?https://imgur.com/)?and post the link here?

    Regards,
    Tobias

    Thread Starter 825mjolen

    (@825mjolen)

    It seems to be the one that I set in the options. The option I am referencing I captured a screenshot for. I have a screenshot below also of it working at the bottom of my table as well. I hope this helps. If it does not let me know and maybe we work something else out.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the screenshots! So this is for the TablePress horizontal scrolling. My guess is that there are maybe JavaScript errors on the page, e.g. as the result of (maybe incomplete) caching. To confirm that, I would need to see the affected page.

    If that really is not public, but password-protected, can you maybe contact me via the email from the bottom of https://tablepress.org/pricing/ ?

    Regards,
    Tobias

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Horizontal Slider Stops Working’ is closed to new replies.