EXTJS4 中的链接组合框

Linked Combobox in EXTJS4

本文关键字:组合 链接 EXTJS4      更新时间:2023-09-26

我正在尝试使用 EXTjs4 创建一个链接的组合框,我正在考虑使用静态数组数据源。我查看了煎茶网站上的示例,但找不到任何示例。谢谢

我过去做过类似的事情。我有两个组合框 - 一个显示员工(valueField:EmployeeID),另一个显示经理(valueField:EmployeeID)。当用户选择员工时,另一个组合框会自动显示该员工的经理。这是我使用的:

var EmployeesComboBox = Ext.create('Ext.form.ComboBox', {
    listeners:{
         'select': function(cbo, records) {
              // set the value of the other combo box to the selected employee ID
              Ext.getCmp('id_of_2nd_combo_box').setValue(records[0].data.EmployeeID);
          }
    }
});