Re: Can I disable sorting in Structures::Datagrid?

From: Date: Mon, 17 Apr 2006 00:36:42 +0000
Subject: Re: Can I disable sorting in Structures::Datagrid?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23678@lists.php.net to get a copy of this message
On 4/16/06, dondo <dondo@myway.com> wrote: > > "Using the PEAR::DB driver means that all of your data is being > pulledinto memory and then sorted and paged. It's highly inefficient. I > hopeyou don't expect much data." > > Yes, that's part of the reason I want to disable the sorting done by DataGrid, but I also > don't expect huge data sets. Here's some more details.. > > Even when I do not pass a third sorting parameter when creating a column, DataGrid appears to > be sorting the data. For example, if I construct a query like: > > SELECT .. FROM .. ORDER BY colA DESC, colB ASC LIMIT 20 > > The results displayed by datagrid are resorted by the first ORDER BY column, disregarding the > second ORDER BY column. I'd like it to just ignore both columns. If possible it would be nice > to not have to disable the header, but I can make my own if I need to. > If you're setting an orderBy request parameter then that is your problem. SDG will use that parameter to automatically sort. Try using another name for it. > Let me know if I should provide more information.. > > Thanks, > Bryan > > --- On Sun 04/16, Justin Patrin < papercrane@gmail.com > wrote: > From: Justin Patrin [mailto: papercrane@gmail.com] > To: dondo@myway.com > Cc: t.bothorel@free.fr, pear-general@lists.php.net > Date: Sun, 16 Apr 2006 11:20:21 -0700 > Subject: Re: [PEAR] Can I disable sorting in Structures::Datagrid? > > On 4/16/06, dondo wrote:>> Thierry,> Thanks for the reply. Unfortunately, I'm > using PEAR::DB instead of DataObjects. I was using Propel before and realized that for this project > I don't need/want to use any kind of object-relational mapping and want to keep it purely > SQL-based.>Using the PEAR::DB driver means that all of your data is being pulledinto memory and > then sorted and paged. It's highly inefficient. I hopeyou don't expect much data.> > Regards,> Bryan>> --- On Sat 04/15, Thierry B. < t.bothorel@free.fr > wrote:> > From: Thierry B. [mailto: t.bothorel@free.fr]> To: pear-general@lists..php.net> Date: Sun, 16 > Apr 2006 00:34:49 +0200> Subject: Re: [PEAR] Can I disable sorting in > Structures::Datagrid?>> Justin Patrin a écrit :> On 4/15/06, dondo wrote:> >>Hi, > I'm currently re-writing a website to use Pear Structures::DataGrid for rendering my HTML > tables. I previously had built my own datagrid-type framework but it has become a mess. It did, > however, allow me to specify > both an orderBy and a thenBy parameter for sorting, which was done by the database. With > DataGrid, I can't seem to get this to work. I can sort the data with both the orderBy and > thenBy parameters in the database of course, but then DataGrid re-sorts it by the orderBy parameter > (from the $_GET array). Can I somehow tell DataGrid not to sort at all? I've tried hacking > the source code a bit but haven't had much luck.>>>>I also don't want to > disable the header links because I want to be able to sort using them as well.>>> Hi,I used > Datagrid for a project last month and discovered by 'trials and errors' that sorting works > well as long as you keep using DataObjects methods. As long as you> run the ->query method, > sorting does not work.Thierry bothorel-- PEAR General Mailing List (http://pear.php.net/)To > unsubscribe, visit: http://www.php.net/unsub.php>> > _______________________________________________> No banners. No pop-ups. No kidding.> Make My > Way your home on the Web - > http://www.myway.com>> --> PEAR General Mailing List > (http://pear.php.net/)> To unsubscribe, visit: > http://www.php.net/unsub.php>>--Justin Patrin > > _______________________________________________ > No banners. No pop-ups. No kidding. > Make My Way your home on the Web - http://www.myway.com > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.general (#23678) next »