Hi,
 
U guess there is a mistake in the following line that you used.
 
  <mx:DataGridColumn columnName="myComputedColumn"
headerText="All" labelFunction="cocanateAll"/>
The above must be:
  <mx:DataGridColumn columnName="{myComputedColumn}"
headerText="All" labelFunction="cocanateAll"/>
 
Pls correct me if any worngs!
 
Thanks.


 
On 10/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Let me reformulate my question. Usually you can use selectedItem.
columnName   to read the value of a row/column of a datagrid. This seems to
work fine as shown in the Flex Sample Explorer ( example below).  But how
can you read the value of a computed column that was added in addition to
the columns returned by the dataprovider?   When I trace the selectedItem
or getItemAt, I only get the dataprovider data and nothing else.

<mx:DataGrid id="dg" width="100%" height="100%"
       dataProvider="{employeeModel.employee}">
       <mx:columns>
           <mx:Array>
               <mx:DataGridColumn columnName="name" headerText="Name"/>
               <mx:DataGridColumn columnName="phone" headerText="Phone"/>
               <mx:DataGridColumn columnName="email" headerText="Email"/>
<!--         How can I read this?   -->
               <mx:DataGridColumn columnName="myComputedColumn"
headerText="All" labelFunction="cocanateAll"/>
<!--   No part of the dataprovider, but shows OK   -->
           </mx:Array>
       </mx:columns>
   </mx:DataGrid>

   <mx:Form>
       <mx:FormItem label="Name">
           <mx:Label text="{dg.selectedItem.name}"/>
       </mx:FormItem>
       <mx:FormItem label="Email">
           <mx:Label text="{dg.selectedItem.email}"/>
       </mx:FormItem>
       <mx:FormItem label="Phone">
           <mx:Label text="{ dg.selectedItem.phone}"/>
       </mx:FormItem>
<!--         How can I read this?   -->
       <mx:FormItem label="">
           <mx:Label text="{dg.selectedItem.myComputedColumn }"/> <!--
This doesn't work  -->
       </mx:FormItem>
<!--           -->


Thanks,
   </mx:Form>




             [EMAIL PROTECTED]          To: [email protected]
            Sent by:                          cc:
             [email protected]        Subject:  [flexcoders] Reading the displayed value in a DataGrid - How to
            10/10/2005 12:45 PM
            Please respond to
            flexcoders






I am using labelFunction for a column in a datagrid. How can I read the
displayed value and not the real value directly from the dataGrid?

I am also wondering how to get values from the DataGrid in general. I need
to render the DataGrid to a HTML table, I mean, read columns and rows from
the dataGrid and have a string with the HTML syntax. I could not find
anything such as getRow, and then read each column. So I am selecting each
Row and then using the selectedItem property.

I know that I could use the function executed in labelFunction to
reproduce the displayed value, but I am actually trying to extend the
DataGrid class and add a method called getHTMLString for example. This
would require to be agnostic of whether the column has a labelFunction or
not.

Any ideas?

Thanks.

---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------





--
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












---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------




------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->

--
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

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
   [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/








--
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




Reply via email to