Re: Re: [datagrid] How to disble automatic sorting ?

From: Date: Wed, 02 Mar 2005 05:55:03 +0000
Subject: Re: Re: [datagrid] How to disble automatic sorting ?
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17780@lists.php.net to get a copy of this message
Andrew Nagy wrote:
Daniel García wrote:
I'd like to use the header links in DataGrid to control sorting of records, but I'd like to handle sorting outside of DataGrid. Is that possible ?
Since DG will want to process the GET values automatically, you can simply destroy the GET values befor instantiating the datagrid: unset($_GET);
That did the job :-)
This should probably be an option, being able to disable automatic sorting/paging.
I think so too
The reason is that the DB backend is sorting the resultset differently than the DataGrid: for example, the DB places numbers at the end, while DataGrid places them at the beginning. The result is that after paginating the result set (also handled externally to DataGrid in order to use DB::limitQuery instead of DB::getAll), the results look funny.
Hmm ... the limitQuery would be a nice way to handle DB as a datasource. However at the current moment, the datagrid binds to the DB_Result object. Maybe it would be nice to bind to a SQL statment and datagrid could then use limitQuery to help with the limiting.
I guess that would solve the performance issues, and the implied automatic pagination / sorting... I guess that a SQL builder would come handy to let the datasource handle the sorting, and could be also useful to add dinamic 'where' conditions. Thanks for your help and kind regards -- Daniel

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