Support » Plugin: WP-Table Reloaded » [Plugin: WP-Table Reloaded] clickable row

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

    (@tobiasbg)

    Hi,

    you can add links to the table cells by either typing/pasting in the HTML code for a link, or by simply using the “Insert Link” button below the table fields. You will be asked for a name and the URL of the link and the necessary code will be created for you.

    Best wishes,
    Tobias

    Thanks Tobias, I know about that option, but that makes only the text or the image clickable, or not?
    I’d like to asign the link to whole row and make all the cells in the row linking to a page. I’m talking about all area of the cell. Would that be possible somehow?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the clarification. Yes, my suggestion would only make a text or image clickable.

    If you want to make the entire area of a row clickable, you will need some custom programming. You will need (for example with the jQuery library) develop JavaScript code that captures the click and then performs your desired action.
    As a start, I suggest to look for a jQuery tutorial, where you can usually find explanations and examples of how to find certain elements on a page (like a table) and assign click handlers to them.

    Regards,
    Tobias

    i did this without jquery..

    added into the extensions plug in example:

    function wp_table_reloaded_hack_row( $row_class, $table_id, $row_idx ) {
    	// row class will normally be output like this:
    	// $row_class = " class=\"{$row_class}\"";
    	// if we insert js in the middle, it might work...
    	// $row_class = " class=\"{old $row_class appeneded with \" onclick="alert('foo')\"';
    
    //	$row_class .= ' \" onclick="alert(\'foo\')';
    	$row_class .= "\" onclick=\"window.location = '/your-link-here'";
        return $row_class;
    }
    
    add_filter( 'wp_table_reloaded_row_css_class', 'wp_table_reloaded_hack_row', 10, 3);
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi!

    For people interested in this, please also see http://wordpress.org/support/topic/plugin-wp-table-reloaded-how-to-add-row-click-support.

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP-Table Reloaded] clickable row’ is closed to new replies.