I've been developing a plugin where I wanted to create a table, styled and working just like Wordpress's native Post/Page tables.
Following the guide below, I was able to create the table and load my database. The only thing I cannot figure out to do is how to make one of the row contents "clickable".
http://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/
IE - making the "name" column clickable. I have the "edit, delete" buttons below the name, but that is not enough.
Any and all advice would be greatly appreciated. I looked at another plugin to see how they did this, and it looked like they broke the table apart and hardcoded the html for the table. I hope I don't have to do this.
EDIT:
The name of the post, Hello world!, as you can see, is a link / clickable.
SOLUTION
to make this work, I had to remove my custom column functions, which included my row actions. Turns out, you can simply call the row actions div! Here is the function that helped me, thanks to the Milo.
function single_row_columns($item) {
list($columns, $hidden) = $this->get_column_info();
foreach ($columns as $column_name => $column_display_name) {
$class = "class='$column_name column-$column_name'";
$style = '';
if (in_array($column_name, $hidden))
$style = ' style="display:none;"';
$attributes = "$class$style";
if ('cb' == $column_name) {
echo "<td $attributes>";
echo '<input type="checkbox" name="id[]" value="%s" />', $item['ID'];
echo "</td>";
}
elseif ('galname' == $column_name) {
echo "<td $attributes>";
echo '<a href="#">', $item['galname'];
echo "</a>";
echo "<div class='row-actions'><span class='edit'>";
echo sprintf('<a href="?page=%s&action=%s&gid=%s">Edit</a>',$_REQUEST['page'],'edit',$item['id']);
echo "</span> | <span class='trash'>";
echo sprintf('<a href="?page=%s&action=%s&gid=%s">Delete</a>',$_REQUEST['page'],'delete',$item['id']);
echo "</span></div></td>";
}
else {
echo "<td $attributes>";
echo $this->column_default( $item, $column_name );
echo "</td>";
} } }
Thanks so much! Jacob