Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 6686ea24

Přidáno uživatelem Jakub Hlaváč před více než 3 roky(ů)

Re #8787 - Přidat unit - úprava formuláře

  • form styling

Zobrazit rozdíly:

src/app/dashboard/components/unit-insert-popup/unit-insert-popup.component.html
1
<p-dialog [visible]="isVisible" [closable]="false" [draggable]="false" header="Add unit!" [style]="{width: '50vw'}" [baseZIndex]="10000" (onShow)="clearFormArray()">
1
<p-dialog [visible]="isVisible" [closable]="false" [draggable]="false" header="Add unit!" [style]="{width: '70vw'}"
2
          [baseZIndex]="10000" (onShow)="clearFormArray()">
2 3

  
3 4
  <form [formGroup]="insertForm">
4 5
    <div class="input-group form-group">
6
      <div class="input-group-prepend">
7
        <span class="input-group-text">Unit ID</span>
8
      </div>
5 9
      <input type="text" formControlName="unitId" class="form-control" id="unitId" placeholder="unitId"/>
6 10
    </div>
7 11
    <div class="input-group form-group">
8
      <input type="text" formControlName="unitDescription" class="form-control" id="unitDescription" placeholder="unitDescription"/>
12
      <div class="input-group-prepend">
13
        <span class="input-group-text">Description</span>
14
      </div>
15
      <input type="text" formControlName="unitDescription" class="form-control" id="unitDescription"
16
             placeholder="unitDescription"/>
9 17
    </div>
18
    <hr>
10 19
    <div class="input-group form-group">
11 20
      <div formArrayName="sensors" *ngFor="let item of insertForm.get('sensors')['controls']; let i = index;">
12 21
        <div [formGroupName]="i">
13
          <input type="text" formControlName="sensorId" class="form-control" id="sensorId" placeholder="sensorId"/>
14
          <input type="text" formControlName="sensorName" class="form-control" id="sensorName" placeholder="sensorName"/>
15
          <input type="text" formControlName="sensorType" class="form-control" id="sensorType" placeholder="sensorType"/>
16
          <select formControlName="phenomenons" id="phenomenons">
17
            <option *ngFor="let phenomenon of phenomenons; let i = index" [value]="phenomenons[i].phenomenonId">
18
              {{phenomenons[i].phenomenonName}} ( {{ phenomenons[i].unit}})
19
            </option>
20
          </select>
22
          <div class="input-group form-group">
23
            <div class="input-group-prepend">
24
              <span class="input-group-text">Sensor ID</span>
25
            </div>
26
            <input type="text" formControlName="sensorId" class="form-control" id="sensorId" placeholder="sensorId"/>
27
          </div>
28
          <div class="input-group form-group">
29
            <div class="input-group-prepend">
30
              <span class="input-group-text">Sensor name</span>
31
            </div>
32
            <input type="text" formControlName="sensorName" class="form-control" id="sensorName"
33
                   placeholder="sensorName"/>
34
          </div>
35
          <div class="input-group form-group">
36
            <div class="input-group-prepend">
37
              <span class="input-group-text">Sensor type</span>
38
            </div>
39
            <input type="text" formControlName="sensorType" class="form-control" id="sensorType"
40
                   placeholder="sensorType"/>
41
          </div>
42
          <div class="input-group form-group">
43
            <div class="input-group-prepend">
44
              <span class="input-group-text">Sensor name</span>
45
            </div>
46
            <select formControlName="phenomenons" id="phenomenons">
47
              <option *ngFor="let phenomenon of phenomenons; let i = index" [value]="phenomenons[i].phenomenonId">
48
                {{phenomenons[i].phenomenonName}} ( {{ phenomenons[i].unit}})
49
              </option>
50
            </select>
51
          </div>
21 52
        </div>
22 53
        <br>
23 54
      </div>
......
25 56
  </form>
26 57

  
27 58

  
28
  <button type="button" (click)="addSensor()">Add Sensor</button>
29

  
30

  
31

  
32

  
33

  
59
  <p-button type="button" (click)="addSensor()" class="pr-2">Add Sensor</p-button>
34 60

  
35 61

  
36 62
  <p-footer>

Také k dispozici: Unified diff