Your code looks OK to me.  So I’d try to debug it further by putting maybe putting an alert on the change event of the datagrid that prints the selectedItem.price and just make sure that all is kosher.  And you can of course move on from there with the various debugging tips we have in the docs J

 

Matt

 


From: digital_eyezed [mailto:[EMAIL PROTECTED]
Sent: Monday, April 11, 2005 3:02 PM
To: [email protected]
Subject: [flexcoders] Extracting Data from a DataGrid

 


Ok, heres the issue:

I have a data grid which is populated from a result of a
remoteObject call, the result is an Array of Value Objects:


<mx:DataGrid id="myDataGrid" dataProvider="{srv.getRates.result}">
<mx:columns>
    <mx:Array>
      <mx:DataGridColumn columnName="supplier" headerText="Company
Name" width="125"/>
      <mx:DataGridColumn columnName="price"  headerText="Price"
labelFunction="formatCurrency" width="75"/>
    </mx:Array>
</mx:columns>
</mx:DataGrid>

Now I want to add a ControlBar at the bottom of the dataGrid which
shows the price when the user selects a row (by clicking on it), so
I created a custom component controlBar and added this line below
the code above:

<comp:taxiControllbar dataObject="(myDataGrid.selectedItem}"/>

and the code for the component is:

<?xml version="1.0" encoding="utf-8"?>
<mx:ControlBar xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
var dataObject:Object;
</mx:Script>
     <mx:Text text="{dataObject.price}"/>
</mx:ControlBar>

Well, it doesn't work when I select the row, and your job is to tell
me how thick I am and say, don't be daft, this is how you do it!

Cheers,

Iain







Yahoo! Groups Links

Reply via email to