如何在teradata covalent中设置TdDynamicFormsComponent的值

时间:2018-02-09 11:40:51

标签: angular teradata-covalent

我想在我的编辑页面上的表单中设置值,然后我就可以编辑了。

public formElements = [
    {
      name: 'market',
      type: TdDynamicElement.Input,
      label: 'market',
      required: true,
      flex: 50
    },
    {
      name: 'commodity',
      type: TdDynamicElement.Input,
      required: true,
      flex: 50,
      label: 'Commodity'
    },
    {
      name: 'time',
      label: 'Time',
      type: TdDynamicElement.Datepicker,
      required: true,
      flex: 50
    }
  ];

我想添加像<input type='text' value='some name'/>

这样的价值

由于

编辑。这是我在html中显示表单的方式

<mat-card>
  <mat-card-content>
    <h5>Add an Market</h5>

    <td-dynamic-forms #formRest [elements]="formElements">
    </td-dynamic-forms>

    <button mat-raised-button color="accent" (click)="submit()">Save</button>
    <button mat-raised-button color="warn" (click)="close()">Cancel</button>
  </mat-card-content>
</mat-card>

1 个答案:

答案 0 :(得分:1)

Covalent Dynamic Forms在表单元素界面上有function initialize() { // create the map var myOptions = { center: new google.maps.LatLng(35.467560, -97.516428), zoom:6, disableDefaultUI: true, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"),myOptions); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); var point = new google.maps.LatLng(35.979088,-96.112985); var marker = createMarker(point,"Firestone, Oklahoma City<br>211 411 2311"); point = new google.maps.LatLng(38.0409333,23.7954601); marker = createMarker(point,"Nespresso S.A.","<b>Nespresso S.A.</b><br>Agiou Thoma 27,15124,Marousi"); point = new google.maps.LatLng(38.0473031,23.8053483); marker = createMarker(point,"Regency Entertainment","<b>Regency Entertainment</b><br>Agiou Konstantinou 49,15124,Marousi <br>210 614 9800"); point = new google.maps.LatLng(38.050986,23.8084322); marker = createMarker(point,"Just4U","<b>Just4U</b> <br>Dimitriou Gounari 84, 15124, Marousi<br>210 614 1923"); point = new google.maps.LatLng(38.0400533,23.8011982); marker = createMarker(point,"Ekka Cars S.A.","<b>Ekka</b> <br>Leoforos Kifisias 79,15124,Marousi<br>210 349 8000"); initSearchBox(map, 'pac-input'); } 属性。您可以使用它来设置初始值。如果数组没有改变,它不会自动更新表单。

default

请参阅以下Stackblitz

中使用的内容