• Resolved idoremus

    (@idoremus)


    Hi Tobias,

    We seem to have lost our previously alternating table row classes. We did have:
    <tr class="row-26 even">
    <tr class="row-27 odd">
    etc.

    Now become:
    <tr class="row-26">
    <tr class="row-27">
    etc.

    It appears to be happening on tables that have horizontal scrolling checked. A good example of a table without alternating color rows and one below that appears to be working properly can be seen at: http://tinyurl.com/aztzqht.

    Thanks in advance for your help,
    Ian

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

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

    (@tobiasbg)

    Hi Ian,

    sorry about that trouble again…

    From what I can see, the reason for this is a JavaScript error that’s halting the DataTables JS library, right when it has started to process the alternating row colors.
    I’m not really sure where that error comes from, but my assumption is that it is related to another issue on your site:
    All Shortcodes seem to be evaluated twice. Due to that, the JS call is embedded twice, and that also can cause trouble.
    Near the bottom of the page’s HTML source, you can see

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

    which however should only be

    $('#tablepress-319').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":['even','odd'],"bPaginate":false,"sScrollX":"100%"});
    $('#tablepress-2').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":['even','odd'],"bPaginate":false,"sScrollX":"100%"});

    Interestingly, I have seen this before, just recently, but we weren’t yet able to find the exact cause. See http://wordpress.org/support/topic/datatables_fixedcolumns-seems-to-break-horizontal-scrolling
    My assumption is that either the theme or another plugin evaluates all Shortcodes of the post, but discards the output (or better the return value) of the Shortcodes. To verify this, could you temporarily deactivate all other plugins and switch to the WP Default theme to see if that changes the JS calls in the page footer to what they should be?

    Regards,
    Tobias

    Thread Starter idoremus

    (@idoremus)

    Hi Tobias,

    Sorry it took me so long to get back. I deactivated all plugins except tablePress and switched to the 2012 theme. I still have the same issue. I am a little puzzled. The only difference between our dev site (which breaks) and our live site that works is the wordpress 3.5 update.

    Thanks again for your help,
    Ian

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Ian,

    well, that puzzles me too. This should not happen with WP 3.5 and just TablePress and a WP Default theme activated, and all other plugins deactivated.

    Can you send me another email with up-to-date details to that dev site, so that I can take another look? (I vaguely remember that you sent me some details some time ago, but I can’t find that mail.)

    Thanks!
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Alternating rows sometimes not working’ is closed to new replies.