hi guys
I have a advanced datagrid. and i have rendered a TextInput in datagrid
coloumn but when i scroll the datagrid data enter in textinput is moving...
between different rendered textInputs.......Pls help me out yaar..... I need
to do task as soon as possible i am going to send here a sample code also...
make sure when you guys check make datagrid scrollable here is the code. i
have also attached the two files.. if somebdy want to import and want to run
and see the problem... Thanks


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
xmlns:ren="*">

<mx:ArrayCollection id="dgArr">

<mx:Array>

 <mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
Tyler" firstName="Jake" />

<mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
McCarthy" firstName="Ryan" />

<mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
Miller" firstName="Jill" />

<mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
Rico" firstName="John" />

<mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
Watson" firstName="Diz" />

<mx:Object markAsReadOnly="" net="" comm="" commPer="" gross="" lastName="
Hurley" firstName="Lolo" />

</mx:Array>

</mx:ArrayCollection>

<mx:AdvancedDataGrid id="dg" itemClick="editCell(event)" rowCount="5"
editable="true" y="100" x="100" dataProvider="{dgArr}" width="794" height="
147">

<mx:groupedColumns>

 <mx:AdvancedDataGridColumnGroup headerText="Commission Calculation">

<mx:AdvancedDataGridColumn editable="false" dataField="gross" headerText="
Gross" />

<mx:AdvancedDataGridColumn editable="false" dataField="commPer"
headerText="Comm
%" />

<mx:AdvancedDataGridColumn editable="false" dataField="comm" headerText="
Comm" />

<mx:AdvancedDataGridColumn rendererIsEditor="true" itemRenderer="Renderer"
dataField="net" headerText="Net" />

</mx:AdvancedDataGridColumnGroup>

</mx:groupedColumns>

</mx:AdvancedDataGrid>

<mx:Script>

<![CDATA[

*import* mx.events.*;

*public* *function* editCell(e:ListEvent):*void*{

dg.editedItemPosition={columnIndex:3,rowIndex:e.rowIndex}

}

]]>

</mx:Script>

</mx:Application>





--------Renderer-------------

<?xml version="1.0" encoding="utf-8"?>

<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="init()"

text="{text1}" restrict="0-9" borderColor="RED"
focusOut="{*this*.text=nf.format(text)}"
focusIn="{*this*.text=num.parseNumberString(*this*.text)}">

<mx:NumberFormatter id="nf" rounding="nearest" thousandsSeparatorTo=","
useThousandsSeparator="true"/>

<mx:Script>

<![CDATA[

*import* mx.controls.AdvancedDataGrid;

*import* mx.formatters.NumberBase;

*import* mx.controls.listClasses.BaseListData;

*import* mx.controls.advancedDataGridClasses.AdvancedDataGridListData;

*import* mx.managers.FocusManager;

*import* mx.events.*;

*import* flash.events.*;

*public* *var* num:NumberBase=*new* NumberBase();

[*Inspectable*(text1=*"rue"*)]
*

public* *var* text1:String;

 *//public var text1:Number=2;
*

*public* *var* textValue:Number=898989;

*var* advg:AdvancedDataGrid;

*var* event1:ListEvent;

*public* *function* clickHandler(e:MouseEvent):*void*{

*this*.text=*""*;

*this*.removeEventListener(MouseEvent.CLICK,clickHandler);

}

  *public* *function* init():*void*{

*this*.addEventListener(MouseEvent.CLICK,clickHandler);

*//if(event1.rowIndex==2)

// this.enabled=false;
*

*//this.text=num.parseNumberString(this.text);
*

}

]]>

</mx:Script>

</mx:TextInput>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Attachment: ADGDataloss.mxml
Description: Binary data

Attachment: Renderer.mxml
Description: Binary data

Reply via email to