选择数据网格项目时,在详细信息表单下拉列表中选择项目

发布于 2024-10-17 08:00:04 字数 1505 浏览 5 评论 0原文

我有这个数据网格:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
             dataProvider="{colCompetente}" editable="false">
    <mx:columns>
        <mx:DataGridColumn headerText="ID Competență" dataField="idCompetenta"/>
        <mx:DataGridColumn headerText="Denumire Competență" dataField="denCompetenta"/>
        <mx:DataGridColumn headerText="Competență Superioară" dataField="idCompSuperioara" rendererIsEditor="true" editorDataField="idCompSuperioara" itemRenderer="renderers.CompetentaSuperioara"/>
    </mx:columns>
</mx:DataGrid>

和这种形式:

<s:Form includeIn="Test" x="536" y="69">
    <s:FormItem label="Denumire competenta">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:TextInput text="{dgCompetenteN.selectedItem.denCompetenta}"/>
    </s:FormItem>
    <s:FormItem label="Competenta superioara">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:DropDownList dataProvider="{colCompetente}" 
                        labelField="denCompetenta">
        </s:DropDownList>
    </s:FormItem>
</s:Form>

我想要做的是,当我在数据网格中选择一项时,下拉列表中的所选项目应该是正确的项目(字段 idCompSuperioara 等于中的第三个元素的项目)选定的数据网格行)。

有什么想法吗?

谢谢。

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
             dataProvider="{colCompetente}" editable="false">
    <mx:columns>
        <mx:DataGridColumn headerText="ID Competență" dataField="idCompetenta"/>
        <mx:DataGridColumn headerText="Denumire Competență" dataField="denCompetenta"/>
        <mx:DataGridColumn headerText="Competență Superioară" dataField="idCompSuperioara" rendererIsEditor="true" editorDataField="idCompSuperioara" itemRenderer="renderers.CompetentaSuperioara"/>
    </mx:columns>
</mx:DataGrid>

and this form:

<s:Form includeIn="Test" x="536" y="69">
    <s:FormItem label="Denumire competenta">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:TextInput text="{dgCompetenteN.selectedItem.denCompetenta}"/>
    </s:FormItem>
    <s:FormItem label="Competenta superioara">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:DropDownList dataProvider="{colCompetente}" 
                        labelField="denCompetenta">
        </s:DropDownList>
    </s:FormItem>
</s:Form>

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

Any ideas?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半衬遮猫 2024-10-24 08:00:04

尝试按照以下方式进行操作:

itemClickHandler:

protected function dgCompetenteN_itemClickHandler(event:ListEvent):void
{
  for each (var o:Object in colCompetente)
  {
    if (o.idCompSuperioara == dgCompetenteN.selectedItem.idCompSuperioara)
    {
      ddlCompetenta.selectedItem = o;
      break;
    }
  }
}

DataGrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149" dataProvider="{colCompetente}" editable="false" itemClick="dgCompetenteN_itemClickHandler(event)">
  <mx:columns>
        <mx:DataGridColumn headerText="ID Competență" dataField="idCompetenta"/>
        <mx:DataGridColumn headerText="Denumire Competență" dataField="denCompetenta"/>
        <mx:DataGridColumn headerText="Competență Superioară" dataField="idCompSuperioara" rendererIsEditor="true" editorDataField="idCompSuperioara" itemRenderer="renderers.CompetentaSuperioara"/>
    </mx:columns>
</mx:DataGrid>

表单:

<s:Form includeIn="Test" x="536" y="69">
    <s:FormItem label="Denumire competenta">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:TextInput text="{dgCompetenteN.selectedItem.denCompetenta}"/>
    </s:FormItem>
    <s:FormItem label="Competenta superioara">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:DropDownList id="ddlCompetenta" dataProvider="{colCompetente}" 
                        labelField="denCompetenta">
        </s:DropDownList>
    </s:FormItem>
</s:Form>

Try something along these lines:

The itemClickHandler:

protected function dgCompetenteN_itemClickHandler(event:ListEvent):void
{
  for each (var o:Object in colCompetente)
  {
    if (o.idCompSuperioara == dgCompetenteN.selectedItem.idCompSuperioara)
    {
      ddlCompetenta.selectedItem = o;
      break;
    }
  }
}

The DataGrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149" dataProvider="{colCompetente}" editable="false" itemClick="dgCompetenteN_itemClickHandler(event)">
  <mx:columns>
        <mx:DataGridColumn headerText="ID Competență" dataField="idCompetenta"/>
        <mx:DataGridColumn headerText="Denumire Competență" dataField="denCompetenta"/>
        <mx:DataGridColumn headerText="Competență Superioară" dataField="idCompSuperioara" rendererIsEditor="true" editorDataField="idCompSuperioara" itemRenderer="renderers.CompetentaSuperioara"/>
    </mx:columns>
</mx:DataGrid>

The form:

<s:Form includeIn="Test" x="536" y="69">
    <s:FormItem label="Denumire competenta">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:TextInput text="{dgCompetenteN.selectedItem.denCompetenta}"/>
    </s:FormItem>
    <s:FormItem label="Competenta superioara">
        <s:helpContent>
            <s:Label text="Help String"></s:Label>
        </s:helpContent>
        <s:DropDownList id="ddlCompetenta" dataProvider="{colCompetente}" 
                        labelField="denCompetenta">
        </s:DropDownList>
    </s:FormItem>
</s:Form>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文