I am not able to follow fully where you are in your function..
I don't see in this trail of messages where you make your DataGrid
call..
Here is what I do..
<mx:DataGrid id="hdGrid" dataProvider="{myHDData}"
alternatingItemColors="[#CCCCCC, #AAAAAA]" x="10" y="10"
change="switchit(event)">
public function switchit(event:Event):void {
var myLogdata:XMLList = new XMLList();
currentState = 'ticketdisplay';
if ( event.target.selectedItem.ticketname ) {
mName.text =
event.target.selectedItem.ticketname;
}
I have no problems...
--- In [email protected], "Greg Morphis" <[EMAIL PROTECTED]>
wrote:
>
> That was a typo instead of copying and pasting..
> mySelectedRow is an ArrayCollection
> I'm assignin the event.target.selectedItem which is a datagrid row
to it..
> I want to knmow why it's not working the way it should...
>
> To learn I'm creating a budgetbook of sorts.. so here's what I have
> copied and pasted..
>
> public function handleChangeEvent(event:DataGridEvent):void
> {
> MyModel.getInstance().SelectedBudgetAC = event.target.selectedItem
as
> ArrayCollection;
> Alert.show(MyModel.getInstance().SelectedBudgetAC.getItemAt
(0).payee);
> var evt:CairngormEvent = new CairngormEvent
(MyControl.EVENT_GET_BUDGET_DETAILS);
> CairngormEventDispatcher.getInstance().dispatchEvent(evt);
>
> }
>
>
> public var Budget:BudgetVO;
> public var BudgetAC:ArrayCollection;
> public var budgetID:Number;
> public var SelectedBudgetAC:ArrayCollection;
>
> sorry about that..
>
>
>
>
>
> On Mon, Oct 6, 2008 at 9:02 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:
> > Then how are you expecting that setting "mySelectedRow" property
will do
> > anything regarding the "SelectedBudgetAC" property?
> >
> > Tracy
> >
> >
> >
> > ________________________________
> >
> > From: [email protected]
[mailto:[EMAIL PROTECTED] On
> > Behalf Of Greg Morphis
> > Sent: Monday, October 06, 2008 8:02 PM
> > To: [email protected]
> > Subject: Re: [flexcoders] handling data within a datagrid
> >
> >
> >
> > No, just global variables
> >
> > On Mon, Oct 6, 2008 at 7:13 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:
> >> Does MyModel handle the relationship between mySelectedRow and
> >> SelectedBudgetAC? Using setters or getters?
> >>
> >> Tracy
> >>
> >>
> >>
> >> ________________________________
> >>
> >> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> >> Behalf Of Greg Morphis
> >> Sent: Monday, October 06, 2008 7:48 PM
> >> To: [email protected]
> >> Subject: [flexcoders] handling data within a datagrid
> >>
> >>
> >>
> >> I've got my datagrid populating but I need to see that data in
aother
> >> location within my app.
> >> In my MyModel.as
> >> I have a "global" variable
> >> public var mySelectedRow:ArrayCollection;
> >>
> >> I've tried setting this variable in the dataGrid change event...
> >> public function handleChangeEvent(event:Event):void
> >> {
> >> MyModel.getInstance().mySelectedRow = event.target.selectedItem
as
> >> ArrayCollection;
> >> Alert.show(MyModel.getInstance().SelectedBudgetAC.getItemAt
(0).amount);
> >> var evt:CairngormEvent = new
> >> CairngormEvent(MyControl.EVENT_GET_DATA_DETAILS);
> >> CairngormEventDispatcher.getInstance().dispatchEvent(evt);
> >>
> >> }
> >>
> >> The Alert returns a null error.. but it looks like it should be
working?
> >> What I'm trying to do is I have a VO I need to populate.. I was
going
> >> to do that within a command (is that best practice? -- to
seperate
> >> display from logic)
> >> So anywho I'm trying to populate that arraycollection and then
in the
> >> command do all the fun stuff...
> >> var myVO:FootVO = MyModel.getInstance().FooVO;
> >> myVO.amount = MyModel.getInstance().SelectedBudgetAC.getItemAt
(0).amount;
> >>
> >> but I'm getting a null error.. is this the proper way to load a
VO
> >> from a selected DataGrid row?
> >>
> >> Thanks
> >>
> >>
> >
> >
>