ソースを参照

Add status.field.bv event triggered after updating the field status (#300, #301)

nghuuphuoc 11 年 前
コミット
d9fe23d85e

+ 1 - 0
CHANGELOG.md

@@ -4,6 +4,7 @@
 
 * [#121](https://github.com/nghuuphuoc/bootstrapvalidator/issues/121): Add events for form validate successfully or not
 * [#195](https://github.com/nghuuphuoc/bootstrapvalidator/issues/195): Add events for field validation
+* Add ```status.field.bv``` event which is triggered after updating the field status. It can be used to solve [#300](https://github.com/nghuuphuoc/bootstrapvalidator/issues/300), [#301](https://github.com/nghuuphuoc/bootstrapvalidator/issues/301)
 * [#164](https://github.com/nghuuphuoc/bootstrapvalidator/issues/164): Add ```container``` option for indicating the element showing all errors
 * [#175](https://github.com/nghuuphuoc/bootstrapvalidator/issues/175): Showing errors in tooltip or popover
 * [#211](https://github.com/nghuuphuoc/bootstrapvalidator/issues/211), [#235](https://github.com/nghuuphuoc/bootstrapvalidator/issues/235): Add new method ```getInvalidFields()``` that returns all invalid fields

+ 3 - 0
dist/js/bootstrapValidator.js

@@ -877,6 +877,9 @@
                     break;
             }
 
+            // Trigger the "status.field.bv" event
+            this.$form.trigger($.Event('status.field.bv'), [field, $field, status]);
+
             this._onValidateFieldCompleted($field);
 
             return this;

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/js/bootstrapValidator.min.js


+ 3 - 0
src/js/bootstrapValidator.js

@@ -876,6 +876,9 @@
                     break;
             }
 
+            // Trigger the "status.field.bv" event
+            this.$form.trigger($.Event('status.field.bv'), [field, $field, status]);
+
             this._onValidateFieldCompleted($field);
 
             return this;