select 下拉列表中的一个选项,并让其他字段根据 selection 自行填写

To select an option in a dropdown and have other fields fill themselves in based on the selection

我正在开发一个应用程序。

我想 select 下拉菜单中的一个选项,并让其他字段根据 selection 自行填写。

我该怎么做?

other fields fill themselves in based on the selection

假设 other fields 是记录的字段并且下拉列表共享相同记录的数据源我可以建议您在下拉列表的 onValueEdit 事件中填充它们的值:

var record = widget.datasource.item;

switch(newValue) {
  case 'xxx':
    record.FieldOne = 'Foo';
    record.FieldTwo = 3;
  break;

  case 'xxx':
    record.FieldOne = 'Bar';
    record.FieldTwo = 42;
  break;

  ...

  default:
     throw new Error('Caused by UFO');
}