Clear error on Knockout-Validation

徘徊边缘 提交于 2019-12-04 22:59:21
Code Novitiate

Probably a better way that follows what is already implemented in knockout validation is to say property.isModified(false);

if you have a whole view model to reset simply loop through all the validated properties and call that isModified(false)

See the comment from Eric Barnard here

Hope that helps

Late answer but if anyone needs it :

// assuming the ko.observable on the checkbox is called propBoolean
var propBooleanlValid = ko.validation.group(self.propBoolean, { deep: false });
propBooleanlValid .showAllMessages(false);

It will hide the message till the next validation.

Clarence Klopfstein

Found the answer by implementing this Pull Request.

https://github.com/Knockout-Contrib/Knockout-Validation/pull/184

Gives me the feature I need.

Stefan

If you use an entity manager make sure to not include the entityAspect in the validation since it is connected to all other entities. Also see How to rollback knockout validation errors?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!