Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 从combobox itemRenderer填充datagrid中的2列_Apache Flex_Actionscript - Fatal编程技术网

Apache flex 从combobox itemRenderer填充datagrid中的2列

Apache flex 从combobox itemRenderer填充datagrid中的2列,apache-flex,actionscript,Apache Flex,Actionscript,我有一个带有组合框itemRenderer的数据网格。我拥有的是一个带有个人id和姓名的网格(网格中有更多的东西,但我正在努力解决这个问题)。在“人名”列中,我有一个组合框,其中包含系统名称和id上的所有人 我想做的是,当我在组合框中选择一个人时,我想让组合框填充人名字段(它是这样做的),但我还想从组合框中取出个人id,并在数据网格中填充个人id列。如果有人能帮我做这件事,我将非常满意。您可以为组合框更改事件中的项指定数据对象的值。像这样的 <mx:DataGridColumn dataF

我有一个带有组合框itemRenderer的数据网格。我拥有的是一个带有个人id和姓名的网格(网格中有更多的东西,但我正在努力解决这个问题)。在“人名”列中,我有一个组合框,其中包含系统名称和id上的所有人


我想做的是,当我在组合框中选择一个人时,我想让组合框填充人名字段(它是这样做的),但我还想从组合框中取出个人id,并在数据网格中填充个人id列。如果有人能帮我做这件事,我将非常满意。

您可以为组合框更改事件中的项指定数据对象的值。像这样的

<mx:DataGridColumn dataField="name" rendererIsEditor="true">
  <mx:itemRenderer>
    <mx:Component>
      <mx:ComboBox  text="{data.name}" dataProvider="{outerDocument.namesList}" 
                    change="{data.id = this.selectedIndex}"  />         
    </mx:Component>
  </mx:itemRenderer>
</mx:DataGridColumn>

你可以通过你想要的方式获得ID的值,这应该会让你知道怎么做