Re: Datagrid Column Sort Path
| From: | Mark Wiesemann | Date: | Sun, 25 Mar 2007 21:27:05 +0000 |
| Subject: | Re: Datagrid Column Sort Path | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26907@lists.php.net to get a copy of this message | ||
Hi Ian,
Ian Warner wrote:
> I wish to change the path for the column header sort links, or
> preferable add some Javascript into this so I can make this work with
> AJAX also.
>
>
> http://triangle/finances/invoices/index?orderBy=code&direction=ASC&page=1
>
> Currently when sorting the links look like above.
>
> I would like to change these too:
>
> r–�
> ºöN¦¨Èhttp://triangle/finances/invoices/index/orderBy/code/direction/ASC/page/1
To achieve this, you would need to overload SDG's HTMLTable renderer and
modify the overloaded buildHeader() method. This is the easy part of
your request.
> I then need to throw these paramaters back into the datagrid
This is the more complicated part. SDG currently expects GET or POST
parameters named "orderBy", "direction" and "page" (maybe prefixed).
A quick solution would be to set $_GET['orderBy'] from your modified URL
before you instantiate the SDG class. Not really a clean solution, yes,
but it would work.
Regards,
Mark
--
http://www.markwiesemann.eu