From 0bd9621ddc928aa0336090cb71052d8fb67376d8 Mon Sep 17 00:00:00 2001 From: Alex Ionochkin Date: Mon, 8 Dec 2014 09:55:02 +0000 Subject: [PATCH] fix for setting input validation result --- src/components/inputs/inputview.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/inputs/inputview.coffee b/src/components/inputs/inputview.coffee index 0d5a372e..51dfaf51 100755 --- a/src/components/inputs/inputview.coffee +++ b/src/components/inputs/inputview.coffee @@ -318,7 +318,9 @@ module.exports = class KDInputView extends KDView for rule in @ruleChain @validationResults[rule] = null + setValidationResult:(rule, err, showNotification=yes)-> + if err @validationResults[rule] = err @showValidationError err if @getOptions().validate.notifications and showNotification @@ -328,9 +330,12 @@ module.exports = class KDInputView extends KDView @validationResults[rule] = null # if there is any true on validation results' values then is not valid - @valid = not (v for own k, v of @validationResults) - .map((result)-> Boolean result) - .indexOf(true) > -1 + @valid = not( + (v for own k, v of @validationResults) + .map((result)-> Boolean result) + .indexOf(true) > -1 + ) + showValidationError:(message)->