For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2007 > Datagrid Column Sort Path









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Datagrid Column Sort Path
Ian Warner

2007-03-25, 7:00 pm

Hi

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/i...tion=ASC&page=1

Currently when sorting the links look like above.


I would like to change these too:


http://triangle/finances/invoices/i...tion/ASC/page/1


I then need to throw these paramaters back into the datagrid

Any help appreciated on this

regards ian

Mark Wiesemann

2007-03-25, 7:00 pm

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/i...tion=ASC&page=1
>
> Currently when sorting the links look like above.
>
> I would like to change these too:
>
> http://triangle/finances/invoices/i...tion/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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com