首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >组合框中DataGrid selectedItem与selectedItem的绑定

组合框中DataGrid selectedItem与selectedItem的绑定
EN

Stack Overflow用户
提问于 2009-11-14 20:24:35
回答 1查看 1.7K关注 0票数 0

在Flex中,如何将ComboBox的selectedItem设置为网格的selectedItem (名称、手机、类别)?如果我在网格(category )中选择一行,那么选中的项目(Category item)必须是categories ComboBox中的selected item。

代码语言:javascript
复制
<mx:DataGrid id="dg" width="425" height="328" rowCount="5" 
  dataProvider="{contactList}" cornerRadius="3" 
  change="selectedItem=(event.target as DataGrid).selectedItem.groupId;">  
<mx:ComboBox id="grpName" dataProvider="{groupsList}" labelField="groupName"
  selectedIndex="{selectedItem}" />
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-11-15 14:09:48

如果ComboBoxDataGrid的数据提供程序相似(具有相同的长度和内容),则可以绑定selectedIndex属性来实现这一点。

代码语言:javascript
复制
<mx:ComboBox selectedIndex="{dg.selectedIndex}"/>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1734107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档