문제

In my flex application im using a datagrid with following columns

<mx:DataGrid x="10" y="265" width="1205" dataProvider="{vendors}"  editable="true" lockedColumnCount="4"   horizontalScrollPolicy="on">
                        <mx:DataGridColumn headerText="Select" editable="false" textAlign="center" >
                        <mx:itemRenderer >
                            <mx:Component>

                                <mx:CheckBox click="data.select = !data.select"  change="outerDocument.addDetail(data)"  selected="{data.select}" > 
                                </mx:CheckBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>

                    <mx:DataGridColumn headerText="One" dataField="one" color="black" editable="false" width="125" />
                    <mx:DataGridColumn headerText="Two" dataField="two" color="black" editable="false" width="125"/>
                    <mx:DataGridColumn headerText="Three" dataField="three" color="black" editable="false"/>
                    </mx:DataGird>

now i want to disable the checkbox column on fetching data..after datas are populated in datagrid if user selects any of the field in datagrid for editing..the checkbox for that selected row should be enabled...other rows checkbox should be disabled..

I hope this information is enough for this requirement

any idea about this?? thankxx in advance...

도움이 되었습니까?

해결책

I dint understand completely your problem but trying to answer it.

<mx:DataGrid x="10" y="265" width="1205" dataProvider="{vendors}"  editable="true" lockedColumnCount="4"   horizontalScrollPolicy="on" id="dgGrid">
                    <mx:DataGridColumn headerText="Select" editable="false" textAlign="center" >
                    <mx:itemRenderer >
                        <mx:Component>

                            <mx:CheckBox click="data.select = !data.select"  change="outerDocument.addDetail(data)"  selected="{data.select}"
enabled="{outerDocument.dgGrid.selectedIndex==outerDocument.vendors.getItemIndex(data)}> 
                            </mx:CheckBox>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>

                <mx:DataGridColumn headerText="One" dataField="one" color="black" editable="false" width="125" />
                <mx:DataGridColumn headerText="Two" dataField="two" color="black" editable="false" width="125"/>
                <mx:DataGridColumn headerText="Three" dataField="three" color="black" editable="false"/>
                </mx:DataGird>

This will work If your dataprovider for grid is an arrayCollection which is declared as public..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top