Commit e67ed994 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

get back for the choices

parent 05e0447f
......@@ -725,12 +725,7 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
allHelps[param_name] = params_per_name[param_name].help;
for (var i in params_per_name[param_name].sub_parameters) {
dataSchema[params_per_name[param_name].sub_parameters[i].name] = null;
// if this is a multiple choice and there is no default value, put the first value in the template
if (params_per_name[param_name].sub_parameters[i].choices != null && params_per_name[param_name].sub_parameters[i]["default"] == null) {
rowTemplate.push(params_per_name[param_name].sub_parameters[i].choices[0]);
} else {
rowTemplate.push(params_per_name[param_name].sub_parameters[i]["default"]);
}
rowTemplate.push(params_per_name[param_name].sub_parameters[i]["default"]);
colHeaders.push(params_per_name[param_name].sub_parameters[i].display_name);
allHelps[params_per_name[param_name].sub_parameters[i].name] = params_per_name[param_name].sub_parameters[i].help;
if (params_per_name[param_name].sub_parameters[i].type == "bool") {
......@@ -738,8 +733,8 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
} else if (params_per_name[param_name].sub_parameters[i].type == "date") {
columns.push({data: params_per_name[param_name].sub_parameters[i].name, type:"bootdate", dateFormat : params_per_name[param_name].sub_parameters[i].format});
} else if (params_per_name[param_name].sub_parameters[i].choices != null) {
var source = params_per_name[param_name].sub_parameters[i].choices.map(String) ;
columns.push({data: params_per_name[param_name].sub_parameters[i].name, type:"dropdown", source:source});
var all_choices = $.merge( [""], params_per_name[param_name].sub_parameters[i].choices );
columns.push({data: params_per_name[param_name].sub_parameters[i].name, type:"dropdown", source:all_choices.map(String)});
} else {
// TODO handle file types selection
allTypes[params_per_name[param_name].sub_parameters[i].name] = params_per_name[param_name].sub_parameters[i].type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment