• Resolved longnha

    (@longnha)


    Hello,

    DataTables FixedHeader, DataTables Sorting plugins, search option are no long on big table.

    At first I thought that it was problem with W3 Total Cache again so I tried to disable the plugin but it still the same. Those functions work on small table but not on big table with 200 rows.

    When check the page source, I still see TablePress JS.

    The most recent change I had that is upgrade to latest Genesis Version: 2.0.1 ยท Released: August 21, 2013. I’m not sure if it cause the problem.

    I hope you could have a look into this.

    Thank you.

    http://wordpress.org/plugins/tablepress/

Viewing 15 replies - 1 through 15 (of 29 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Could you please post a link to the page with the table that’s not working, so that I can have a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Yes, here is not working table:

    http://www.digitalcashpalace.com/forex-brokers-comparison/

    Hope you can figured out something. Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link! I think that this is related to the script minification in W3 Total Cache. Can you please try again after turning that off. It looks like the jQuery JS library gets garbled by that…

    Also, there’s PHP code visible in the page

    <?php
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
    wp_enqueue_script('jquery');
    ?> <?php
    wp_deregister_script('swfobject');
    wp_register_script('swfobject', 'http://ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js');
    wp_enqueue_script('swfobject');
    ?>

    that should not be there. Please check if you see that in your theme’s “header.php” and delete it.

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Hi Tobias,

    I deleted those PHP code that you mentioned and disable Minify feature in W3 Total Cache but it still does not work.

    I had another table and it work fine:

    http://www.digitalcashpalace.com/binary-options-brokers/

    The only different that the first table seem bigger!

    Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ok, thanks for deleting that, and for turning off the minification for now.

    Indeed, it looks like this is not the reason for this. Instead, the problem seems to be that the Shortcode is evaluated twice on the page. For the small table, that does not matter, as that’s not using the FixedHeader Extension. The bigger table however does use the FixedHeader Extension, and that doesn’t like being evaluated twice.

    You should therefore try to find out why the Shortcodes on the page are evaluated twice. My assumption is that this is done by your theme, so please start by switching to the WordPress default theme TwentyFourteen temporarily.

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Hi Tobias,

    Thank you very much for your support.

    I switched to default theme and test but the result is still same. So, the problem may not lie within the theme.

    I tried to disable fixed header and just use normal TablePress code, the Search and Sorting functions back to work as normal. So, I think the problem come from the fixed header plugin or the two plugin FixedHeader and DataTables Sorting plugins just do not work well together.

    I hope you can figure out where the problem lie.

    Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for checking this! That then means that another plugin is causing the double-evaluation of the Shortcode.
    If you check near the bottom of the HTML source of the page (“View source” in the browser), you will see this:

    $('#tablepress-11').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":['even','odd'],"bPaginate":false,"bInfo":false});
    $('#tablepress-11-no-2').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":['even','odd'],"bPaginate":false,"bInfo":false});

    and that’s too much.

    The problem is not directly in the FixedHeader Extension, that’s just affected by this, as the first evaluation of the Shortcode is “thrown away”.

    So, if this is not caused by the theme, it’s another plugin. Please try disabling all other plugins except TablePress one by one, until there’s only

    $('#tablepress-11').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":['even','odd'],"bPaginate":false,"bInfo":false});

    in the HTML source of the page.

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Hi Tobias,

    Thanks for your suggestion, I found the plugin that cause the problem: WordPress SEO by Joost de Valk. Disable the plugin – shortcode generated one, enable it – twice.

    Could you figure out how to fix it? or I need to contact WordPress SEO author to inform about the error?

    Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great find! ๐Ÿ™‚
    That’s what’s causing the problem then!

    Yes, please contact Joost about this then. I know of many plugins that do the same as TablePress (namely print JavaScript code to the page when the Shortcode is evaluated), so that this likely affects a lot of sites.
    I’ll also dive into the WordPress SEO code to see if I can find the exact cause and maybe a workaround.

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    I already found something. The problem seems to stem from the call to do_shortcode() in the function WPSEO_OpenGraph::image() in the file “/frontend/class-opengraph.php” of WordPress SEO.
    That indeed evaluates the Shortcode, but throws the output away. However, TablePress will then enqueue the JS code, which is the only option.

    I’m not sure what the reason is for WordPress SEO to evaluate the Shortcodes there…

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Hi Tobias,

    Great find. As you found the problem come from WPSEO_OpenGraph, I tried to disable “Add Facebook Open Graph meta data” and the shortcode is no longer double-evaluation.

    I guess the problem is solved now.

    Thank you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great idea again! ๐Ÿ™‚ Good to see that the plugin allows to deactivate this! ๐Ÿ™‚

    And even better that you were now able to enable the FixedHeader Extension and the Minification again! ๐Ÿ™‚

    Best wishes,
    Tobias

    Hi,
    I have a similar problem and I think it came after I installed WP 3.6. I lost possibilities to sort and search in table. I can send you some exported file if you give me email where to send.
    Affected page is here
    http://nuuksioclassic.com/ilmoittautuminen/osanottajat/

    Best Regards,
    Kari

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Kari,

    thanks for your post, and sorry for the trouble.

    No, from what I can see, there’s something wrong in your theme. The footer is not being loaded properly.

    To find out more about this, please try changing the “WP_DEBUG” constant to “true” in the wp-config.php file on the server.
    Then, please check if you are seeing an error message at the bottom of the page.

    If that does not help, please temporarily switch to the WordPress default theme Twenty Thirteen, to see if it’s working there. Thanks!

    Regards,
    Tobias

    Thanks,
    I chanced it, but now I got extra text in the page

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘DataTables FixedHeader, DataTables Sorting plugins, search option are no long’ is closed to new replies.