You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using bootstrap with bootstrap modals. I have main viewModel for page itself (applyBindings() on main content DIV element) and another viewModel for my modal window (another call to applyBindings()).
If I apply bindings to modal DIV before I do the same for main page DIV, settings applied to ko.validation.init() are ignored.
BUT it does work if I do any of the following:
Call applyBindings() first on the modal and then on the page.
Instead of applyBindings() I call applyBindingsToNode() and then applyBindingsToDescendants() for modal.
Call ko.validation.init() before first call to applyBindings() on the page.
Use applyBindingsWithValidation() instead of applyBindings() for view modal where I need custom validation settings.
The text was updated successfully, but these errors were encountered:
Ok now I understand what's actually happening. If applyBindings() is called on any element BEFORE ko.validation.init(), than these settings stop working.
phobos2077
changed the title
Validation not working with several binding contexts
Validation settings are ignored after applyBindings() is called
Dec 1, 2016
I'm using bootstrap with bootstrap modals. I have main viewModel for page itself (
applyBindings()
on main content DIV element) and another viewModel for my modal window (another call toapplyBindings()
).If I apply bindings to modal DIV before I do the same for main page DIV, settings applied to
ko.validation.init()
are ignored.BUT it does work if I do any of the following:
applyBindings()
first on the modal and then on the page.applyBindings()
I callapplyBindingsToNode()
and thenapplyBindingsToDescendants()
for modal.ko.validation.init()
before first call toapplyBindings()
on the page.applyBindingsWithValidation()
instead ofapplyBindings()
for view modal where I need custom validation settings.The text was updated successfully, but these errors were encountered: