Re: Can I disable sorting in Structures::Datagrid?
| From: | dondo | Date: | Sat, 22 Apr 2006 19:28:05 +0000 |
| Subject: | Re: Can I disable sorting in Structures::Datagrid? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23805@lists.php.net to get a copy of this message | ||
Thanks Olivier. Unfortunately this didn't work for me. I think the only way is to write my
own table heading code.
regards,
Bryan
--- On Mon 04/17, Olivier Guilyardi < ojaiml@nerim.net > wrote:
From: Olivier Guilyardi [mailto: ojaiml@nerim.net]
To: dondo@myway.com
Cc: papercrane@reversefold.com, pear-general@lists.php.net
Date: Mon, 17 Apr 2006 18:01:54 +0200
Subject: Re: [PEAR] Can I disable sorting in Structures::Datagrid?
dondo wrote:>>If you're setting an orderBy request parameter then that is
>yourproblem. SDG will use that parameter to automatically sort. Try >using another name for
it.> > > I thought about doing that, but didn't want to disable the headings. It
appears I have to write my own header code to get this to work the way I want it to. Ideally there
would be a method that could override the automatic sorting so that the table headers didn't
get disabled. One of the reasons I wanted to use DataGrid was to avoid having to write the header
code. > I think that the best way to do what you want (disable sorting but keep links) is to
subclass the datasource driver and overload sort() with an empty method.Example:class MyDataSource
extends Structures_DataGrid_DataSource_DB{ function sort($sortSpec,$sortDir) { }}$datasource
= new
MyDataSource();$datasource->bind($yourDBResult);$datagrid->bindDataSource($datasource);-- og
_______________________________________________
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com