Reputation: 363
im my flex application i have a datgrid as follows
<mx:DataGrid id="grid" >
<mx:columns>
<mx:DataGridColumn headerText="Select" dataField="itemSelInd" editable="false" textAlign="center" >
<mx:itemRenderer >
<mx:Component>
<mx:CheckBox>
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="date" headerText="Date"/>
<mx:DataGridColumn dataField="month" headerText="Month"/>
<mx:DataGridColumn dataField="year" headerText="Year"/>
</mx:columns> </mx:DataGrid>
by default editable = false;
now if i select a checkbox the corressponding row alone should become editable how its possible?? give me some suggestions..thankxx in advance!!
Upvotes: 0
Views: 6221
Reputation: 1885
try this
<mx:ArrayCollection id="sad">
<mx:source>
<mx:Object itemSelInd="true" named="sudharsanan" date="0" month="4" year="1989"/>
<mx:Object itemSelInd="false" named="sudharsanan" date="1" month="4" year="1989"/>
<mx:Object itemSelInd="true" named="sudharsanan" date="0" month="4" year="1989"/>
</mx:source>
</mx:ArrayCollection>
<mx:DataGrid id="asad" editable="true" dataProvider="{sad}">
<mx:columns>
<mx:DataGridColumn headerText="Select" dataField="itemSelInd" editable="false" textAlign="center" >
<mx:itemRenderer >
<mx:Component>
<mx:CheckBox click="{data.itemSelInd = !data.itemSelInd}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="named" headerText="Name" >
<mx:itemEditor>
<mx:Component>
<mx:TextInput editable="{data.itemSelInd}" text="{data.named}"/>
</mx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="date" headerText="Date" >
<mx:itemEditor>
<mx:Component>
<mx:TextInput editable="{data.itemSelInd}" text="{data.date}"/>
</mx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
I hope this might help you
Upvotes: 2