Support » Plugin: TablePress » Make row Clickable

  • Resolved Mark2201

    (@mark2201)


    Hi,

    I recently started using Tablepress and I think it is a great tool, keep up the good work 🙂

    I have made a table and i want to make a row clickable where it uses the link which I use in the right column.

    This is the site: http://www.forento.be/pensioensparen/

    In the right column there will be links and the whole row should be clickable.

    I have been searching on Google but i have been unable to find a solution for this.

    Many thanks for your help.

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

Viewing 14 replies - 16 through 29 (of 29 total)
  • Tobias,

    Nevermind, I just got it to work. I had another plugin that was causing the issue. Your plugin rocks!

    I made the mistake of buying wpDataTables. I am getting a refund now. I will be making a donation soon.

    Thanks,
    John

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi John,

    very nice! Good to hear that everything is working now 🙂
    And wpDataTables is not a bad program, it just has a different target audience.

    @brian: You are very welcome! 🙂

    Best wishes,
    Tobias

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

    Is there a way to make the javascript work on ALL tables. I have some pages with 10-20 tables and having to put 20 javascript codes per page is quite bad 🙂

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, that’s possible. Just change the selector part in the JS code from e.g.

    $('.tablepress-id-1')

    to

    $('.tablepress')

    Regards,
    Tobias

    Tobias, you’re awesome, thank you!

    I donated, not much but money is tight due to owing taxes in our business. Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    good to hear that this helped! Thanks for the nice words and for the donation, I really appreciate it!

    Best wishes,
    Tobias

    Hi,
    is there a way to make the link open in a new window (i.e. target=”_blank”)?

    Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, that’s not possible with the JS solution, as that doesn’t have the “power” to open a new tab or window.
    (It might be possible to open a popup, but many users have blocked that and consider it bad practice, so I wouldn’t recommend that.)

    Regards,
    Tobias

    Hi TobiasBg

    I have similary problem like user Mark2201 .

    I made table with 5 columns and 5 rows.I want when someone click wherever on first row to be linked on another page.Same like Mark2201 used on this page : http://www.forento.be/beleggen/

    I tried to find in Appearance/Editor table and to put code :
    <tr style=”cursor:pointer” onclick=”document.location.href=”blah.html”

    But I can’t find “table code” in Appearance/Editor.
    Do I need to install some plagin?
    How I can do this ?

    Please when you explain me,explain me step by step.Because I am new with using wordpress.

    Thank you for reply and help 🙂
    Best Regards

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    As you are using TablePress as well, you won’t find the HTML code that you mentioned in an editor, simply because that is generated on the fly by TablePress.
    Using inline JavaScript is a bad practice anyway. Instead, I suggest to look into the JS code from my first reply above. That uses jQuery to trigger a click to a link in the table, when a row is clicked.
    That simply needs to be adjusted to your table and then placed below the table Shortcode on the page, in <script> tags.

    Regards,
    Tobias

    Thank you Tobias for quickly reply 🙂

    If I understood I need to put second code in Custom CSS”/ “Plugin Options”:

    .tablepress-id-1 tr:hover {
        cursor: pointer;
    }

    I just didn’t understad where to post first code ?

    <script type="text/javascript">
    jQuery(document).ready(function($){
      $('.tablepress-id-1').on( 'click', 'tr', function() {
        var $a = $(this).find('a').last();
        if ( $a.length )
          window.location = $a.attr('href');
      } );
    });
    </script>

    Do I need to change something in this codes?
    Or exactly same codes to put?

    Sorry for disturbing

    Best Regards

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    that second piece of code needs to go into content of the page/post which has the table. Just put that below the Shortcode on the “Edit” window of the page. (Make sure to use the “Text” editor there and not the “Visual” editor.)

    Regards,
    Tobias

    thank you very much!

    Everything now works!

    Thank you for the quick responses

    Best Regards

    Plugin Author TobiasBg

    (@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 14 replies - 16 through 29 (of 29 total)
  • The topic ‘Make row Clickable’ is closed to new replies.