0 Replies Latest reply on Sep 25, 2009 3:24 AM by rlongia

    Problem with BD control "TextArea" inside itemRenderer on DataGrid >>> Flash Builder 4.




      I am facing a problem as if i use the spark control "TextArea" inside itemRenderer on a mx:DataGrid.

      Actually i have to set the TextAlignment (either from left or from right) in a datagrid column at run time.

      Also the text may be in diff languages like Arabic , English... . As the Arabic starts from left to right.

      To be able to handle the direction of the text we can use the TextArea as it is birectional. As this component is working in its own.

      But the problem appears when i use this inside the itemrenderer on a datagrid. First problem is : i'm not able to access the datafield for the column.


      i am doing like this:

      <mx:DataGrid dataProvider="{arr1}">


         <mx:DataGridColumn headerText="Script"   headerStyleName="headerCustomStyle" wordWrap="true" width="300">





                     <mx:TextArea text="{data.StrPromptText}" textAlign="left" styleName="{outerDocument.setStyle1(data.I32LevelId)}"                                      verticalScrollPolicy="off" selectable="false" editable="false"/>








      as in the above code sample data.StrPromptText giving me the error says "Access of undefined property data".

      The other problem is that i am not able to call the method that is out side of the control. As in the above code sample the call outerDocumnet.setStyle1(data.I32LevelId). Even if i have no such problem, it gives me an error at run time says : Can not convert the specified control to the itemListitemRenderer. Is it possible to put this(spark.controls.textArea) control in side the itemRenderer at all ?



      As i know the same concept is working in flex 3.