RE: [PEAR-DEV] Proposal - HTML_DataGrid - Again

From: Date: Mon, 09 Feb 2004 15:21:19 +0000
Subject: RE: [PEAR-DEV] Proposal - HTML_DataGrid - Again
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25560@lists.php.net to get a copy of this message
> -----Original Message----- > From: Hans Lellelid [mailto:hans@appliedsec.com] > > Hi - > > >I haven't yet had a chance to play with PHP5 much, I hope that > someone will > >be able to help me with this. > >I also REALLY want to port this to a PECL package so that it > offers a strong > >competitor to c# datagrid. > > > > > Yeah, I would think that PHP5's interfaces and in particular the SPL > Iterator / IteratorAggregate interface would provide a great benefit to > a tool like this. Of course having it in C would be cool too :) -- but > I'll be quite content to use a PHP version. Well, Hopefully I can find someone to help make this more PHP5 friendly as I would rather focus on porting to C. :) > > > >I have implemented a column "formatter". This IMHO is really cool and an > >invention of one of my co-workers. Basically you define a > function that you > >want to display the results of in the cell, and you can pass in elements > >from the dataset. So I can have a printLink function or a printImage > > > That's an awesome solution. While I know that this is an HTML tool -- One comment, by Joe Stump, questioned as to whether (due to the many different types of output) this really is an HTML package or not. > and therefore specifying HTML attribs in API should be completely > acceptible -- it seems to me that having the href stuff as part of the > API might not be flexible enough. E.g. if I wanted to use a button > instead of the text as the link ... would I run into trouble? It sounds > like this formatter idea takes care of all those issues. I wonder also Yes, the formatter can handle any type of output you need. > whether it would make sense to have a subclass like EditableDataGrid > which had its own methods that apply to editing (and things like > specifying links would be part of that clas rather than base DataGrid > class). Seems like creating editable datagrids would be a common task & > it may make sense to have special (easier) support for that. Maybe not > -- just thinking out loud. Definitely! This is something that is implemented in the .net datagrid. I will begin thinking about an extended class that will implement editing and deleting records. > > >As you can see, I am a big proponent of "Quick and Dirty" > methods. The app > >programmer should be able to implement the DataGrid with just a > few lines of > >code and get something very effective, this tends to damper the design of > >the code a bit, but is nicer in the long run. > > > > > I agree -- these tools should all make it as easy as possible to get > results. As a programmer, though, I'm also willing to do a little more > work to accommodate an underlying library that is going to provide more > long-term flexibility. I used to think that flexibility in things > like output format was really nice in theory but rarely used in > practice; however, I've found myself recently using tools like XSL more > & more as I have projects that need to output to HTML, XML, and create > Excel spreadsheets, etc. Interesting ... more to think about! > > BTW -- Great tool! :) Thanks! Andrew

« previous php.pear.dev (#25560) next »