0

I want to create a table like structure in Flex, with labels as header. The rows entries might be a check box or a text input box,Like give below.

select | task name | task id | task type

(check box) | (text box) | (text box) | (text box)

(check box) | (text box) | (text box) | (text box)

Or can I create a data grid and have text input boxes or check boxes as column values?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Angeline
  • 2,369
  • 22
  • 68
  • 107

1 Answers1

4

Yes you can. Set the DataGridColumn's editable and rendererIsEditor properties to true to get TextInputs in the cells. Use custom item renderer to get check boxes.

<mx:XMLListCollection id="listCol" source="{xmlList}"/>
<mx:XMLList id="xmlList" xmlns="">
    <item>
        <text>Text 1</text>
        <flag>true</flag>
    </item>
    <item>
        <text>Text 2</text>
        <flag>false</flag>
    </item>
</mx:XMLList>
<mx:DataGrid dataProvider="{listCol}">
    <mx:columns>
        <mx:DataGridColumn editable="true" rendererIsEditor="true" 
            editorDataField="selected">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:CheckBox selected="{data.flag == 'true'}"/>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn editable="true" rendererIsEditor="true" 
            dataField="text"/>
    </mx:columns>
</mx:DataGrid>
Amarghosh
  • 58,710
  • 11
  • 92
  • 121