Re: Re: [datagrid] How to disble automatic sorting ?
| From: | Justin Patrin | Date: | Wed, 02 Mar 2005 06:05:39 +0000 |
| Subject: | Re: Re: [datagrid] How to disble automatic sorting ? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17781@lists.php.net to get a copy of this message | ||
On Wed, 02 Mar 2005 06:55:03 +0100, Daniel García <listas@quintopino.com> wrote:
> 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.
>
SQL builder? Hmmm, sounds like DB_DataObject, which is a DataSource for SDG.. ;-)
--
Justin Patrin