I’m surprised there aren’t more issues. The DG wasn’t designed for this capability.
On 2/18/10 10:48 AM, "Shailesh M" <[email protected]> wrote: Not sure if I completely follow your example. Goal is to re-adjust the height of row as user type data in itemEditor (TextArea). calling dataGrid.invalidateList() does trick but introduces following issue (https://bugs.adobe.com/jira/browse/SDK-25540). I looked at your example and tried to implement the contains method, no luck. We really cant have popup editor. Is there any way (other then dataGrid.invalidateLIst()) which can force dataGrid to resize the current (focused) row? -Shailesh --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , Alex Harui <aha...@...> wrote: > > Maybe try the DG with popup editor example on my blog > > -- > Alex Harui > Flex SDK Team > Adobe System, Inc. > http://blogs.adobe.com/aharui > > > On 2/17/10 3:59 PM, "Shailesh M" <shailesh.man...@...> wrote: > > > > > > > This seems very similar to > http://tech.groups.yahoo.com/group/flexcoders/message/116052 > http://www.flex888.com/712/datagrid-with-flexible-row-height.html > > and calling dataGrid.invalidateList(); from within itemEditor works fine. > There seems to be a bug in DataGrid whereby, if editing in itemEditor causes > itemEditor scrollBars to disappear, itemEditor position changes to one line > above and both rows start getting edited. Here is the code sample to > reproduce it. > > Steps: > 1. Click on row 2, last column > 2. Select all the text, and hit delete > 3. Notice that cursor in on row 1 > 4. Start typing, notice both rows are getting the data > 5. Click outside, editor closes, both rows have same data. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" > creationComplete="creationComplete()"> > <mx:Script> > <![CDATA[ > import mx.collections.ArrayCollection; > > private function creationComplete():void{ > var arr:Array = [] > arr.push(getObj("1", "nameOne", "Some Desc")); > arr.push(getObj("2", "name2", "Some Desc\n asdf\n test \n test\n test\n > test\n test\n test")); > arr.push(getObj("3", "name3", "Some Desc")); > arr.push(getObj("4", "name4", "Some Desc")); > arr.push(getObj("5", "name5", "Some Desc")); > arr.push(getObj("6", "name6", "Some Desc")); > rolesDG.dataProvider = new ArrayCollection(arr); > } > > private function getObj(_id:String, _name:String, _desc:String):Object{ > return { id: _id, name:_name, description:_desc }; > } > > ]]> > </mx:Script> > <mx:DataGrid id="rolesDG" width="100%" editable="true" > variableRowHeight="true"> > <mx:columns> > <mx:DataGridColumn headerText="#" dataField="id" textAlign="center" > width="20" editable="false"/> > <mx:DataGridColumn headerText="Role" dataField="name" width="150" > textAlign="center" /> > <mx:DataGridColumn headerText="Description" dataField="description" > dataTipField="description" > width="300" editorUsesEnterKey="true"> > <mx:itemEditor> > <mx:Component> > <mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml" > keyUp="keyPressed(event)"> > <mx:Script> > <![CDATA[ > import mx.controls.DataGrid; > import mx.controls.dataGridClasses.DataGridListData; > private function keyPressed(event:Event):void{ > data[DataGridListData(this.listData).dataField] = this.text; > > DataGrid(this.owner).invalidateList(); > } > ]]> > </mx:Script> > </mx:TextArea> > </mx:Component> > </mx:itemEditor> > </mx:DataGridColumn> > </mx:columns> > </mx:DataGrid> > </mx:Application> > > > > > > > -- > Alex Harui > Flex SDK Team > Adobe System, Inc. > http://blogs.adobe.com/aharui > -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui

