[flexcoders] Re: rowIndex columnIndex while rendering in Flex 2.0

2006-03-15 Thread t_msreddy
Manish
What if I have two textboxes in the cellRenderer 
HBox label={weekHoursActual.text}
   TextInput id=weekHoursActual text={...} /
   TextInput id=weekHoursForecast text={...} /
/HBox

what will the editorProperty be? 

Also can you tell me how to get the rowIndex and columnIndex. My 
dataProvider to DataGrid is 2 Dimensional, one dimension represents 
the row and the other the columns so that any cell(i,j) value will 
be dataProvider[i][j].
So I need to know atleast columnIndex in Cellrenderer so that my 
value will in it will be dataObject.object[columnIndex].someValue.

Thanks




--- In flexcoders@yahoogroups.com, Manish Jethani 
[EMAIL PROTECTED] wrote:

 On 3/14/06, t_msreddy [EMAIL PROTECTED] wrote:
  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
 [snip]
 
  -
  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
  -
 
 It's trying to access the non-existent `text` property on HBox.  
Add a
 `text` property, or, faster, set `editorProperty` to label and 
bind
 the HBox's label to the TextInput's text.
 
  HBox label={weekHoursActual.text}
   TextInput id=weekHoursActual text={...} /
  ...
 
 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

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




Re: [flexcoders] Re: rowIndex columnIndex while rendering in Flex 2.0

2006-03-15 Thread Manish Jethani
On 3/15/06, t_msreddy [EMAIL PROTECTED] wrote:

 What if I have two textboxes in the cellRenderer
 HBox label={weekHoursActual.text}
   TextInput id=weekHoursActual text={...} /
   TextInput id=weekHoursForecast text={...} /
 /HBox

 what will the editorProperty be?

If my understanding is correct (and I don't have access to the docs
ATM), editorProperty is the property that contains the data.  It has
to be one property.  In your above case, the editorProperty will still
be label (HBox).  The question is, which of the two text boxes will
populate the label?  That's for you to answer.  It could be both.

 Also can you tell me how to get the rowIndex and columnIndex. My
 dataProvider to DataGrid is 2 Dimensional, one dimension represents
 the row and the other the columns so that any cell(i,j) value will
 be dataProvider[i][j].
 So I need to know atleast columnIndex in Cellrenderer so that my
 value will in it will be dataObject.object[columnIndex].someValue.

The row and column index is in the listData property.  This has been
answered a number of times recently - look up the archives.

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

* 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] Re: rowIndex columnIndex while rendering in Flex 2.0

2006-03-14 Thread t_msreddy
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 flexcoders@yahoogroups.com, 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: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Manish Jethani
 Sent: Friday, March 10, 2006 1:51 PM
 To: flexcoders@yahoogroups.com
 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/
 





Re: [flexcoders] Re: rowIndex columnIndex while rendering in Flex 2.0

2006-03-14 Thread Manish Jethani
On 3/14/06, t_msreddy [EMAIL PROTECTED] wrote:
 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
[snip]

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

It's trying to access the non-existent `text` property on HBox.  Add a
`text` property, or, faster, set `editorProperty` to label and bind
the HBox's label to the TextInput's text.

 HBox label={weekHoursActual.text}
  TextInput id=weekHoursActual text={...} /
 ...

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

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