bugs with radiobox&combobox
This commit is contained in:
parent
4f2fb712cf
commit
0d47fe0fd6
|
@ -13,7 +13,7 @@ export class ComboboxComponent implements OnInit{
|
|||
options = [{id:"autocomplete", value: "autocomplete"}, {id:"wordlist", value: "wordlist"}];
|
||||
|
||||
ngOnInit(){
|
||||
if (this.dataModel.data){
|
||||
if (this.dataModel.data && this.form.get("data")){
|
||||
this.type = this.form.get("data").get("type").value;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<div [formGroup]="form" class="form-row">
|
||||
<div formGroupName="data">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div formGroupName="data">
|
||||
|
||||
<div formArrayName="options">
|
||||
<div *ngFor="let option of form.get('data').get('options').controls index as i">
|
||||
<div [formGroupName]="i">
|
||||
|
|
|
@ -17,9 +17,10 @@ export class RadioBoxComponent implements OnInit{
|
|||
private options = new Array<ListingItem>();
|
||||
|
||||
ngOnInit(){
|
||||
if (this.form.get("data")) this.form.removeControl("data");
|
||||
//if (this.form.get("data")) this.form.removeControl("data");
|
||||
if (!this.form.get("data"))
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
this.addNewRow();
|
||||
if(!this.dataModel.data) this.addNewRow();
|
||||
}
|
||||
|
||||
addNewRow(){
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div formGroupName="viewStyle">
|
||||
<div class="form-group">
|
||||
<label>View style</label>
|
||||
<select class="form-control" formControlName="renderStyle">
|
||||
<select class="form-control" formControlName="renderStyle" (change)= "onchangeCombo($event)">
|
||||
<option value="textarea">textarea</option>
|
||||
<option value="booleanDecision">booleanDecision</option>
|
||||
<option value='combobox'>combobox</option>
|
||||
|
|
|
@ -48,6 +48,6 @@ export class FieldFormComponent {
|
|||
}
|
||||
|
||||
onchangeCombo() {
|
||||
debugger;
|
||||
if (this.form.get("data")) this.form.removeControl("data");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue