[drupal-devel] Multiple sortable tables on one page?

Evan Heidtmann evan.heidtmann at gmail.com
Tue Jul 26 19:44:05 UTC 2005


Thanks, Tim. 

That is a good example of how to make a sorted table, but I'm looking
for how to have more than one table on the same page, and have them
all independently sortable.

-Evan

On 7/26/05, Tim Altman <web at timaltman.com> wrote:
> On Tue, 26 Jul 2005 20:35:41 +0200, Evan Heidtmann
> <evan.heidtmann at gmail.com> wrote:
> 
> > The pager API provides a nice way to have multiple page-able tables on
> > one page: the $element argument to theme('pager') and pager_query().
> >
> > But as far as I can tell, there is no way to do the same with the
> > tablesort API. Am I mistaken?
> 
>         I think so.  Check out
> http://drupaldocs.org/api/4.6/function/comment_admin_overview.
> Specifically, the following lines should do what you want (IINM):
> 
>    $sql = 'SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp,
> c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM
> {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '.
> db_escape_string($status);
>    $sql .= tablesort_sql($header);
>    $result = pager_query($sql, 50);
> 
> --
> Tim Altman
>



More information about the drupal-devel mailing list