Maintenance - Mise à jour mensuelle Lundi 7 Décembre 2021 entre 7h00 et 9h00

Commit e61663e2 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Improve requiredIf for handsontables

parent a7ad1cef
......@@ -197,7 +197,7 @@
});
}
else {
var param_parts = param.split(">")
var param_parts = param.split(">");
var obj_param = $("#" + param_parts[0] + "___" + param_parts[1].replace("_", "-"));
if (obj_param.length == 0) {
$this.$element.on("change_" + param.replace("_", "-").replace(">", "___"), function (e, value) {
......@@ -358,7 +358,13 @@
}
else {
handsontables[param_name.split("___")[0]].allRequired[param_name] = false;
}
var nbRows = handsontables[param_name.split("___")[0]].handsontable("getData").length;
for (var row = 0; row < nbRows; row++) {
$this.handsontable_errors[param_name + "." + row] = undefined;
$(handsontables["sample"].handsontable("getCell", row, handsontables[param_name.split("___")[0]].columns.indexOf(param_name)))
.removeClass("htInvalid")
}
}
}
}
......
......@@ -944,10 +944,12 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
allRequired = {},
allHelps = {};
handsontables[param_name] = $.extend($(this), {
allRequired: allRequired
allRequired: allRequired,
columns: []
});
allHelps[param_name] = params_per_name[param_name].help;
for (var i in params_per_name[param_name].sub_parameters) {
handsontables[param_name]["columns"].push(params_per_name[param_name].sub_parameters[i].name);
dataSchema[params_per_name[param_name].sub_parameters[i].name] = null;
rowTemplate.push(params_per_name[param_name].sub_parameters[i]["default"]);
colHeaders.push(params_per_name[param_name].sub_parameters[i].display_name);
......
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