Re: DB_DataObject and Structures_DataGrid integration
| From: | Justin Patrin | Date: | Tue, 10 Aug 2004 17:10:39 +0000 |
| Subject: | Re: DB_DataObject and Structures_DataGrid integration | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32538@lists.php.net to get a copy of this message | ||
On Tue, 10 Aug 2004 13:41:00 +0200, Olivier Guilyardi <ml@xung.org> wrote:
> Hi Justin,
>
> Justin Patrin wrote:
> > On Mon, 09 Aug 2004 18:12:59 +0200, Olivier Guilyardi <ml@xung.org> wrote:
> >>
> >>I want to bind Structures_DataGrid to DB_DataObject in a more integrated
> >>manner than Structures_DataGrid_Record_DataObject.
> >>
> >>My constatation is :
> >
> >
> > ...I don't understand the word you used here.
>
> According to WordNet :
>
> constatation
> n : an assumption that is basic to an argument
>
> >> - DataObject can sort and limit the data
> >> - Datagrid knows how the user wants her data sorted and limited
> >>
> >>Given that, I believe DataGrid and DataObject can interact in a bilateral
> >>way :
> >> - DataObject providing data to DataGrid (which DataGrid_Record_DataObject
> >> implements for a single record)
> >> - DataGrid telling DataObject what data to retrieve according to the user
> >> wish.
> >>
> >>While implementing this for my own needs, I may turn it into reusable code.
> >>
> >>How do you think I should go :
> >>- improving DataGrid_Record_DataObject ?
> >>- creating DB_DataObject_DataGrid (my current favourite) ?
> >>- creating a driver for DB_DataObject_FormBuilder ("FormBuilder_DataGrid") ?
> >>- something else ?
> >>
> >
> > Given that I know nothing about DataGrid, I can't really answer your
> > question, but I doubt a display driver for FormBuilder would do what
> > you want. FormBuilder is about showing a form for a *single* record.
> > Of course, you could us eit to format your data and then output
> > it...as I do in the frontend I wrote.
>
> I've been experimenting with frontend, it's nice but too intrusive to me.
> I want to set up my own HTML_menu, and use the smart templating
> features of DataGrid.
>
The thing about the frontend is that it's all customizable through the
FormBuilder options in your DataObjects. You can change the rendered
fields, field labels, etc. in the DataObject and it will be
automatically changed in the Frontend.
I did plan on making it more plug-and-play so you could supply your
own rendering class(es), but I got basically no interest, so I've been
concentrating instead on FormBuilder development.
> I thought about a driver for FormBuilder because I need fields names to
> labels translation. But, reading the good docs :) I just realized this
> is encapsulated in the DataObject with the fieldLabels property. This is
> elegant. So you're right, a Formbuilder driver is irrelevant, although
> I don't see the point with forcing your forms to act on single records :
> think of a spreadsheet-like form...
Well, FormBuilder (at least orignally) was supposed to make a form for
editing or inserting a single record. In point of fact, that's what
it's still for. I hacked my way around it, freezing the forms and
making a special QuickForm renderer to make a table. It could be very
possible to make this work better.
>
> > Sounds like you should be adding a driver to DataGrid to me. Perhaps
> > you could add a FormBuilder renderer as well so that you can use
> > FormBuilder's link displaying capabilities.
>
> Structures_DataGrid is .NET'ish. And browsing the related .NET
> documentation, I can see there are many data providers, but it always
> end up with a : datagrid->datasource = someDataProvider.
>
> According to this, you definitely are right about adding a driver to
> DataGrid.
>
> Do you think I can do this by creating a new package ? Or should I
> modify DataGrid ?
Well, I would say work on it as if it's part of DataGrid (i.e. put it
in the correct directory), then, once you hae something working, send
it in to the DataGrid maintainers.
You *may* want to look into using some of FormBuilder's functions for
things like getting text for linked records. I can help you with that
if you like.
>
> --
> og
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--