1

私のフレックスアプリケーションでは、次の列を持つデータグリッドを使用しています

<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>

今、私はデータをフェッチする際にチェックボックス列を無効にしたい..ユーザーが編集のためにデータグリッドのフィールドのいずれかを選択した場合、データがデータグリッドに入力された後..その選択した行のチェックボックスを有効にする必要があります...他の行のチェックボックスを無効にする必要があります..

この情報がこの要件に十分であることを願っています

これについて何か考えはありますか?? よろしくお願いします...

4

1 に答える 1

0

私はあなたの問題を完全に理解していませんが、それに答えようとしています。

<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>

これは、グリッドのデータプロバイダーが public.. として宣言されている arrayCollection である場合に機能します。

于 2011-12-02T10:00:47.423 に答える