diff --git a/resource/web/event_config.tmpl b/resource/web/event_config.tmpl index 10476b75..b73df495 100755 --- a/resource/web/event_config.tmpl +++ b/resource/web/event_config.tmpl @@ -118,10 +118,17 @@ $.each(button.attr(), function(fieldName, value) { if(fieldName.startsWith("data-")) { fieldName = fieldName.substring(5); - // case insensitive search - modal.find("input").filter(function() { + input = modal.find("input").filter(function() { return this.name.toLowerCase() == fieldName; - }).val(value); + }); + if (input.attr("type") == "checkbox") { // special handling for checkboxes + if (value=="true") input.attr("checked", "true"); + else input.removeAttr("checked", "true"); + // Add default false value as a unchecked checkbox is not included in the post + input.parent().prepend(""); + } else { + input.val(value); + } } }); }); @@ -174,7 +181,7 @@ {{#.isTypeString()}}{{/#.isTypeString()}} {{#.isTypeInt()}}{{/#.isTypeInt()}} - {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} + {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} {{#.isTypeEnum()}} "); + } else { + input.val(value); + } } }); }); @@ -306,7 +313,7 @@ {{#.isTypeString()}}{{/#.isTypeString()}} {{#.isTypeInt()}}{{/#.isTypeInt()}} - {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} + {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} {{#.isTypeEnum()}} "); + } else { + input.val(value); + } } }); }); @@ -280,7 +288,7 @@ {{#.isTypeString()}}{{/#.isTypeString()}} {{#.isTypeInt()}}{{/#.isTypeInt()}} - {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} + {{#.isTypeBoolean()}}{{/#.isTypeBoolean()}} {{#.isTypeEnum()}}