Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用淘汰赛验证来创建自定义验证器,并尝试使用淘汰赛映射插件创建的视图模型。验证在我第一次运行代码时触发,但在我单击保存或更改输入中的值时不会触发。
在下面的小提琴中,我试图确保 LL 小于 L 并且 L 小于 H。在测试数据中,我的 L 值小于 LL,因此您可以看到报告了一个错误,但是当我更正时验证器不会触发的输入字段中的数据。
http://jsfiddle.net/davidoleary/quSpZ/
这是一个工作小提琴。
http://jsfiddle.net/quSpZ/4/
我将您的代码重组为具有一个 ScheduleEntry 对象,并将验证移到该对象内。该对象还设置为具有属性的可观察对象,因此它们将在更改时触发验证。