これを行う方法がわかりません。今いくつか試してみたので、質問します。以下は私が欲しいものを示しています。私はそれを機能させる方法がわかりません。
いくつかの質問と関連する回答を含む AC があります。これらは DG に表示する必要があり、DG の行と列が AC にバインドされるという考え方です。たとえば、question1 への回答が [はい] の場合、[はい] ボタンは true でなければならず、他の両方のボタンは false でなければなりません (通常のラジオボタン グループの動作と同様)。しかし、ボタンをクリックして変更すると、それに応じて AC のアクション データフィールドが変更されます。私はここで十分に明確ですか?
動的アンケートのメンターです。どんな助けでも大歓迎です。
<?xml version = "1.0"?>
<mx:Application xmlns:mx = "http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var questions : ArrayCollection = new ArrayCollection([
{ question: 'Question 1', anwer: 'Yes' },
{ question: 'Question 2', anwer: 'No' },
{ question: 'Question 3', anwer: 'Unknown' }, ]);
]]>
</mx:Script>
<mx:Panel title = "Questionaire example" height = "100%" width = "100%" paddingTop = "10"
paddingLeft = "10" paddingRight = "10">
<mx:DataGrid id = "dg" width = "100%" height = "100%" dataProvider = "{questions}">
<mx:columns>
<mx:DataGridColumn dataField = "question" headerText = "Questions"/>
<mx:DataGridColumn width = "80" textAlign = "center" editable = "false"
headerText = "Yes">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalAlign = "center" verticalAlign = "middle">
<mx:RadioButton/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn width = "80" textAlign = "center" editable = "false"
headerText = "No">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalAlign = "center" verticalAlign = "middle">
<mx:RadioButton/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn width = "80" textAlign = "center" editable = "false"
headerText = "Unknown">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalAlign = "center" verticalAlign = "middle">
<mx:RadioButton/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>