[development] D7 and Tablesort

Nancy Wichmann nan_wich at bellsouth.net
Mon Sep 21 20:04:24 UTC 2009


Guess I got lucky:
  $select = db_select('node', 'n')->extend('TableSort');
  $results = $select->fields('n', array('nid', 'title', 'type', 'created',
'status', 'sticky', 'promote'))->orderByHeader($header)->execute();

Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
Jr.


-----Original Message-----
From: development-bounces at drupal.org
[mailto:development-bounces at drupal.org]On Behalf Of Sascha Grossenbacher
Sent: Monday, September 21, 2009 3:41 PM
To: development at drupal.org
Subject: Re: [development] D7 and Tablesort


On Mon, Sep 21, 2009 at 9:15 PM, Will Moy <idealworld at orange.net> wrote:
> Berdir's helpful advice already is integrated into the Dynamic Queries
page
> [1] but as you say, feel free to add whatever else you learn :)
>
> [1] http://drupal.org/node/310075

I updated the example a bit, because it contained a quite common
error. The extend() method does return a new object that needs to be
used. See http://drupal.org/node/508796 for more information and an
example.

Berdir
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.110/2385 - Release Date: 09/21/09
05:51:00



More information about the development mailing list