|
Here's the basic steps for Flex 1.5:
- put a button in your cellrenderer
- if ActionScript, register for the click event,
and provide a click function delegate in the cell renderer
- if MXML, point click event to a event handler
function in the cellrenderer
- in your event handler for the button's click,
have it dispatch an event
- in your DataGrid container, register for the
custom click event; can only do this via code since you made up the event name,
and DataGrid.as won't have your event in the metadata
So, some psuedo code for your
cellrenderer:
var ref:Button =
Button(createChild(Button));
ref.addEventListener("click", Delegate.create(this,
onClick));
function onClick(event:Object):Void
{
listOwner.dispatchEvent({type:
"makeNameForThisEventMeaningful", target: listOwner, bubbles:
true});
}
And, some code for your container:
function onCreationComplete()
{
yourDataGrid.addEventListener("makeNameForThisEventMeaningful",
Delegate.create(this, onClicked));
}
function onClicked(event:Object):Void
{
// button was clicked in
datagrid, do HTTPService.send stuff
}
Make sense?
----- Original Message -----
From: Jonathan
Miranda
Sent: Tuesday, January 31, 2006 1:13 PM
Subject: RE: [flexcoders] DataGrid Renderer and referencing
back Hey jester, thanks for
the reply
but could give a real basic example of this? So would I need
someEventObject in both the application mxml and the renderer mxml so that it
would call both? _________________________________________ Jonathan
Miranda Flexible
Master of the Web "In the game of
chess, it's important to never let your opponent see your
pieces." From:
You can dispatch an event that
bubbles in your cellrenderer, and your main app can catch this event, and then
resend the HTTPService. Since the event is not internal to DataGrid's
metadata, you can only subscribe via code. ----- Original Message -----
From: Jonathan
Miranda Sent: Tuesday,
January 31, 2006 12:29 PM Subject:
[flexcoders] DataGrid Renderer and referencing
back I have a custom cellRenderer which
has a button in it
and when that button is pressed, I want to force the datagrid
to resend its HTTPService to get an update. How can I reference my HTTPService
in the main app, when my custom cellRenderer is in a separate mxml
file? _________________________________________ Jonathan
Miranda Flexible Master
of the Web -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS
|
- Re: [flexcoders] DataGrid Renderer and referencing back JesterXL
- RE: [flexcoders] DataGrid Renderer and referencing b... Jonathan Miranda

