From 93fff280d3e0ba4951c07ff4504759773a5b3267 Mon Sep 17 00:00:00 2001 From: MichaelVyverman Date: Fri, 21 Jun 2019 10:11:31 +0200 Subject: [PATCH] add function to modify enabled/disabled closes #55 --- Controls/Controls.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Controls/Controls.js b/Controls/Controls.js index 68e3bfc..40b2bf2 100644 --- a/Controls/Controls.js +++ b/Controls/Controls.js @@ -1070,6 +1070,15 @@ define([ return true; }; + /** + * Modifies the enabled state of the droplist + * @param {boolean} newStatus - new enabled status + */ + control.setEnabled = function(newStatus) { + control._disabled = !newStatus; + control._getSub$El('').prop("disabled", control._disabled); + }; + return control; }; @@ -1319,7 +1328,7 @@ define([ */ control.setValid = function(valid) { control._valid = valid; - $el = $("#" + control._getSubId('')); + var $el = $("#" + control._getSubId('')); if (valid) $el.removeClass('invalid'); else @@ -1437,6 +1446,15 @@ define([ control.performNotify(); }; + /** + * Modifies the enabled state of the edit control + * @param {boolean} newStatus - new enabled status + */ + control.setEnabled = function(newStatus) { + control._disabled = !newStatus; + control._getSub$El('').prop("disabled", control._disabled); + }; + return control; };