Re: DB_DataObject and Structures_DataGrid integration

From: Date: Fri, 13 Aug 2004 15:09:12 +0000
Subject: Re: DB_DataObject and Structures_DataGrid integration
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32625@lists.php.net to get a copy of this message
Markus Wolff wrote:
Olivier Guilyardi wrote:
Personnally, I think the .NET way to attach event handlers is very interesting. As I proposed previously this could be done with : $column = new Structures_DataGrid_Column_Link("Edit"); $column->attachEventHandler("edit_callback_function"); $datagrid->addColumn($column);
Why attachEventHandler? This method name makes sense only if there are in fact multiple events that can be fired by a column class. What events would this be? When would they be fired? How are they being triggered?
Well, this was just pseudo-code. It's an event fired when the user clicks an Edit button. The edit_callback_function would be call with the corresponding record key passed as argument, and should handle displaying a form. It's just like the old good UI event/handler paradigm. Of course, here, the event can only be "clicked".
If it's just for formatting of the column's content, why not call it "formatCallback" or something like that? Having "event" in the name is a bit misleading, IMHO, as it suggests an observer mechanism in place. And for those, we'll (hopefully) soon have official PEAR naming standards :-)
Sorry, there was a confusion between formatter callbacks as provided by DataGrid, and event handling callbacks as triggered by user actions. I did not clearyl express my thoughts.
(Btw. a general all-purpose event handling package will soon be proposed. Stay tuned.)
This is interesting. I was just thinking about it ;) -- og

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