relevant code snippets would help.
 
Generally, .as files in a mx:script tag are part of the outerDocument if
they are public methods.
 
I assume the main app is called Product_Maintenance?

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bredwards358
Sent: Tuesday, May 20, 2008 8:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Help me understand the datagrid



Now, I've been coding in flex for about six or seven weeks now and
things seem to be going swimmingly so far, until I now have to climb
the brick wall that is trying use more of the functions of the data
Grid or actually the advanced data Grid than I was ever used to. Given
the sheer number of topics on the subject I imagine my plight is
pretty common. Until recently I typically used a data Grid to display
information, now that I've become aware of its more intuitive
functions such as inline item renderers.

My main problem so far is this. I have a window which brings up an
initial data grid full of products drawn from a SQL Lite database
table. The data provider for the grid is an ArrayCollection containing
the results of the select statement. At the far left of the grid, are
two button columns added via itemRenderers, one for removing a product
entry, another for editing a currently existing item. I can do the
logic for the actual updating and deleting to the database, but
correct me if I'm wrong as I believe that I simply need to execute the
statement where the primary key is equal to the selected index of the
datagrid, however modified via increment since the grid index is one
behind the table as I've noticed.

Anyhoo, I am aware of the outerDocument.whateverFunction(); deal with
controls made with itemRenderer but it doesn't work in my case since
all of the actionscript in my documents is in a .as file separate from
the .mxml file and referred to as the source in the <mx:script/> tag.
I try to use outerDocument and I get the error:

1061: Call to a possibly undefined method editItem through a reference
with static type Product_Maintenance.

So what can I do to get at the function inside the .as file? I've
tried simply placing a script tag within the itemRenderer but it
throws a parse error regardless of whats inside.



 

Reply via email to