FSN#55310 Onverwacht gedrag Multiacties UDR Module
svn path=/Website/trunk/; revision=40612
This commit is contained in:
@@ -174,11 +174,6 @@ function model_reportcolumns(usrrap_key, params)
|
||||
}
|
||||
};
|
||||
|
||||
this.hook_pre_multi_edit = function(obj, fld, params)
|
||||
{
|
||||
fld.visible.required = false; // bij multi-edit moet vinkje voor visible gelijk kunnen worden gezet.
|
||||
};
|
||||
|
||||
this.hook_pre_post = function (params, obj)
|
||||
{
|
||||
if (obj.id == -1)
|
||||
|
||||
@@ -461,15 +461,17 @@ function scaffolding_edit(model, scf_params)
|
||||
{
|
||||
$("input[type=text],input[type=checkbox],input[type=number],input:not([type]),select, textarea").not(".fldtime").not(".processingtime").not("[class^='fldflex']").not("[class^='fldSflex']").each(function() {
|
||||
if ($(this).hasClass('flddate'))
|
||||
var cb_name = "scf_multi_" + $(this).attr("id").substr("show_".length);
|
||||
var fld_name = $(this).attr("id").substr("show_".length);
|
||||
else if ($(this).hasClass("suggest"))
|
||||
var cb_name = "scf_multi_" + $(this).attr("id").substr(0, $(this).attr("id").length-5);
|
||||
var fld_name = $(this).attr("id").substr(0, $(this).attr("id").length-5);
|
||||
else
|
||||
var cb_name = "scf_multi_" + $(this).attr("name");
|
||||
var cb = $("<input type='checkbox'>").attr("name", cb_name);
|
||||
var fld_name = $(this).attr("name");
|
||||
cb_name = "scf_multi_" + fld_name;
|
||||
var cb = $("<input type='checkbox'>").attr("name", cb_name).attr("id", cb_name).attr("req_"+cb_name, $(this).hasClass("required"));
|
||||
var td = $("<td class='multi_cb'></td>").append(cb);
|
||||
$(this).closest("tr").find("td.label").before(td);
|
||||
|
||||
$(this).removeClass("required").val(""); // initieel niets invullen omdat checkbox niet aangevinkt is.
|
||||
// Zetten vinkje als je waarde invult
|
||||
if ($(this).hasClass('suggest'))
|
||||
{ // Suggest veld: Functie putCheckmarkSuggest() aan sgonchange koppelen.
|
||||
@@ -482,25 +484,36 @@ function scaffolding_edit(model, scf_params)
|
||||
}
|
||||
else
|
||||
{ // Andere velden dan suggest veld.
|
||||
$(this).change(function()
|
||||
{
|
||||
if ($(this).is(":checkbox"))
|
||||
var isgevuld = $(this).is(":checked")
|
||||
else
|
||||
var isgevuld = $(this).val();
|
||||
$("input[type=checkbox][name=" + cb_name + "]").prop("checked", isgevuld);
|
||||
});
|
||||
$(this).change(function()
|
||||
{
|
||||
var fld = "scf_multi_" + $(this).attr("name");
|
||||
var isverplicht = $("#"+fld).attr("req_"+fld) == "true";
|
||||
if ($(this).is(":checkbox"))
|
||||
var isgevuld = $(this).is(":checked")
|
||||
else
|
||||
var isgevuld = $(this).val();
|
||||
|
||||
$("#"+fld).prop("checked", isgevuld);
|
||||
if (isverplicht)
|
||||
$(this).addClass("required");
|
||||
});
|
||||
}
|
||||
|
||||
// Wissen waarde als je vinkje weghaalt
|
||||
cb.change(function(deze) {
|
||||
return function() {
|
||||
if (!$(this).is(":checked"))
|
||||
$(deze).val("");
|
||||
else if ($(deze).hasClass("required"))
|
||||
// Vinkje is aangevinkt en waarde is leeg.
|
||||
// Als het veld verplicht is het vinkje er weer afhalen.
|
||||
$(this).prop("checked", false);
|
||||
return function() {
|
||||
if (!$(this).is(":checked"))
|
||||
{
|
||||
$(deze).val("");
|
||||
$(deze).removeClass("required");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($(this).attr("req_"+$(this).attr("name"))=="true")
|
||||
{
|
||||
$(deze).addClass("required");
|
||||
}
|
||||
}
|
||||
}
|
||||
}(this));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user