fieldset with multiplicity
This commit is contained in:
parent
16fd7a8c88
commit
2c45254e53
|
@ -159,6 +159,7 @@ export class DatasetsComponent implements OnInit {
|
|||
}
|
||||
|
||||
getDatasets(muted?: boolean){
|
||||
this.spinnerService.show();
|
||||
this.serverService.getDatasetForDmp({ "id": this.dmpIdforDatasets }).subscribe(
|
||||
response => {
|
||||
this.tableData = response;
|
||||
|
@ -167,6 +168,9 @@ export class DatasetsComponent implements OnInit {
|
|||
},
|
||||
error => {
|
||||
simple_notifier("danger",null,"Could not update datasets table");
|
||||
},
|
||||
() =>{
|
||||
this.spinnerService.hide();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -181,26 +181,28 @@ export class dataModelBuilder {
|
|||
} else {
|
||||
//this.dataModel.fields.push(field);
|
||||
}
|
||||
if (dataValues[fieldGroup._id][field.key] != undefined){
|
||||
let keys = new Array<string>();
|
||||
Object.keys(dataValues[fieldGroup._id]).forEach(key=>{if(key.startsWith(field.key+"_"))keys.push(key)})
|
||||
if (keys.length)
|
||||
if (field.controlType == "textbox") {
|
||||
let newfield: FieldBase<any>;
|
||||
let rule = new Rule();
|
||||
newfield = new TextboxField({
|
||||
label: field.label+"_"+ 1,
|
||||
key: keys[0],
|
||||
value: dataValues[fieldGroup._id][keys[0]].value,
|
||||
order: field.order,
|
||||
rules: field.rules,
|
||||
visible: field.visible,
|
||||
group: field.group,
|
||||
description: field.description
|
||||
});debugger;
|
||||
newfldGroup.groupFields.push(newfield);
|
||||
}
|
||||
}
|
||||
//TO DO FIELDSET WITH MULTIPLICITY
|
||||
// if (dataValues != "")
|
||||
// if (dataValues[fieldGroup._id][field.key] != undefined){
|
||||
// let keys = new Array<string>();
|
||||
// Object.keys(dataValues[fieldGroup._id]).forEach(key=>{if(key.startsWith(field.key+"_"))keys.push(key)})
|
||||
// if (keys.length)
|
||||
// if (field.controlType == "textbox") {
|
||||
// let newfield: FieldBase<any>;
|
||||
// let rule = new Rule();
|
||||
// newfield = new TextboxField({
|
||||
// label: field.label+"_"+ 1,
|
||||
// key: keys[0],
|
||||
// value: dataValues[fieldGroup._id][keys[0]].value,
|
||||
// order: field.order,
|
||||
// rules: field.rules,
|
||||
// visible: field.visible,
|
||||
// group: field.group,
|
||||
// description: field.description
|
||||
// });debugger;
|
||||
// newfldGroup.groupFields.push(newfield);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue