当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript FormUtils.setInitialValues方法代码示例

本文整理汇总了TypeScript中novo-elements.FormUtils.setInitialValues方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FormUtils.setInitialValues方法的具体用法?TypeScript FormUtils.setInitialValues怎么用?TypeScript FormUtils.setInitialValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在novo-elements.FormUtils的用法示例。


在下文中一共展示了FormUtils.setInitialValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(private formUtils: FormUtils) {
   // Dynamic
   this.dynamicVertical = formUtils.toControls(MockMeta, '$ USD', {}, { token: 'TOKEN', military: true });
   formUtils.setInitialValues(this.dynamicVertical, { number: 0, firstName: 'Bobby Flay' });
   this.dynamicVerticalForm = formUtils.toFormGroup(this.dynamicVertical);
 }
开发者ID:bullhorn,项目名称:novo-elements,代码行数:6,代码来源:vertical-dynamic-form-example.ts

示例2: constructor


//.........这里部分代码省略.........
            data: (item: any): string => {
              return item['label'];
            },
          },
          {
            label: 'Id',
            data: (item: any): string => {
              return item.value['id'];
            },
          },
        ],
      },
    });
    this.rowMultiPickerControlWithMaxlength = new PickerControl({
      key: 'rowMultiPickerControlWithMaxlength',
      tooltip: 'Multiple Rows With Maxlength',
      label: 'Multiple Rows With Maxlength',
      multiple: true,
      maxlength: 4,
      config: {
        format: '$name',
        options: cities,
        type: 'candidate',
        columns: [
          {
            label: 'Name',
            data: (item: any): string => {
              return item['label'];
            },
          },
          {
            label: 'Id',
            data: (item: any): string => {
              return item.value['id'];
            },
          },
        ],
      },
    });
    this.textPickerWithGetLabels = new PickerControl({
      key: 'textPickerWithGetLabels',
      tooltip: 'Text Value Picker with getLabels()',
      label: 'Text Value Picker with getLabels()',
      multiple: false,
      config: {
        field: 'value',
        format: '$label',
        options: states,
        useGetLabels: true,
        getLabels: (value) => {
          return new Promise((resolve) => {
            states.forEach((state) => {
              if (state.value === value) {
                resolve(state);
              }
            });
          });
        },
      },
    });
    let controls = [
      this.singlePickerControl,
      this.multiPickerControl,
      this.entityMultiPickerControl,
      this.multiPickerControlWithMaxlength,
      this.multiPickerControlWithMaxlengthAndPreselects,
      this.rowMultiPickerControl,
      // this.rowMultiPickerControlWithMaxlength,
      this.textPickerWithGetLabels,
    ];
    formUtils.setInitialValues(controls, {
      entityMultiPicker: [
        {
          title: 'Federal Bank',
          name: 'Federal Bank',
          email: 'info@federalbank.com',
          phone: '(545) 555-1212',
          address: { city: 'Arlington', state: 'VA' },
          searchEntity: 'ClientCorporation',
        },
      ],
      multiPickerControlWithMaxlengthAndPreselects: ['Oranges', 'Bananas'],
      rowMultiPickerControlWithMaxlength: [
        {
          id: 1,
          name: 'Boston',
        },
        {
          id: 5,
          name: 'Houston',
        },
        {
          id: 6,
          name: 'Chicago',
        },
      ],
      textPickerWithGetLabels: 'MD',
    });
    this.pickerForm = formUtils.toFormGroup(controls);
  }
开发者ID:bullhorn,项目名称:novo-elements,代码行数:101,代码来源:picker-controls-example.ts


注:本文中的novo-elements.FormUtils.setInitialValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。