I have the same problem. I need to know rowIndex and columnIndex to 
populate values in cellrenderer (Please see the code for both 
below). Also I get the error:
------------------
ReferenceError: Error #1069: Property text not found on WeekHoursCR 
and there
 is no default value
        at 
mx.controls::DataGrid/mx.controls:DataGrid::cellEditorCellEndEditH
andler()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.controls::DataGrid/endEdit()
        at mx.controls::DataGrid/deactivateHandler()
------------------

Here is the Datagrid code:
------------------
<mx:DataGrid id="weekHoursDG" height="341" hScrollPolicy="auto" 
width="100%" rowCount="17" sortableColumns="false" 
dataProvider="{projectsDetailsList.projectDetails
[projectsDG.selectedIndex].projectWeekHours.employeeDetails}"
                                editable="true" 
cellBeginEdit="onCellBeginEdit(event);" cellEndEdit="onCellEndEdit
(event);">
        <mx:columns>
        <mx:Array>
                <mx:DataGridColumn headerText="week1" width="160" 
isCellEditor="true" cellRenderer="WeekHoursCR"/>
                <mx:DataGridColumn headerText="week2" width="160" 
isCellEditor="true" cellRenderer="WeekHoursCR"/>
        </mx:Array>
        </mx:columns>
</mx:DataGrid>
-----------------
This is my Cellrenderer (WeekHourCR.mxml):
-----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.macromedia.com/2005/mxml"; width="100%" 
height="100%" horizontalGap="0" verticalAlign="top" >
        <mx:TextInput id="weekHoursActual" width="40" height="20" 
textAlign="center" text="{(dataObject.employeeHours
[0]).forecastHours}" />
        <mx:TextInput id="weekHoursForecast" width="40" height="20" 
textAlign="center" text="{(dataObject.employeeHours
[0]).actualHours}" />
</mx:HBox>
-----------------










--- In [email protected], "Dustin Mercer" <[EMAIL PROTECTED]> 
wrote:
>
> Another way is to cast the list data to DataGridListData I.E.
> 
> DataGridListData(listData).rowIndex 
> or
> DataGridListData(listData).coulmnIndex
> 
> Dustin Mercer
> 
> -----Original Message-----
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Manish Jethani
> Sent: Friday, March 10, 2006 1:51 PM
> To: [email protected]
> Subject: Re: [flexcoders] rowIndex & columnIndex while rendering 
in Flex 2.0
> 
> On 3/10/06, stchavan <[EMAIL PROTECTED]> wrote:
> 
> > In Flex 2.0, we can get rowIndex and columnIndex for a datagrid 
cell,
> > when it is being edited, by using event.rowIndex and 
event.columnIndex
> > (where event is a DataGridEvent like cellBeginEdit, cellEndEdit 
etc.)
> > Similarly, how can we retrieve the rowIndex and columnIndex, 
when a
> > cell is being rendered for the first time?
> 
>  ListBase(listData.owner).getItemIndices()
> 
> I'm not sure it's a public, documented method in Beta 1 (or even 
Beta
> 2), but it's the one to use basically.
> 
> Manish
> 
> 
> --
> 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
>







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



Reply via email to