我正在使用Knockout,wijmo和Jquery验证。 作为正确工作的jquery验证要求的一部分,必须分配所需的类。 当使用knockout完成此操作时,它将覆盖wijmo指定的类。 因此放弃任何花哨的CSS。 我想在课堂上附加要求。
Knockout正在使用模板从数据库中分配正确的输入。
<script type="text/html" id="WijmoTextAreaControl"> <textarea rows="5" data-bind="wijtextbox: {}, value: Value, wijtooltip: {title: 'Tooltip should be linked to an observable'}, attr: {placeholder: DatabaseName.PlaceholdText, class: DatabaseName.class}" /> </script>class:binding用必需的替换wijmo类。 无论如何都要将类信息附加到绑定。
I'm using Knockout, wijmo, and Jquery Validation. As part of the requirement for jquery validation to correctly work one must assign the class required. When this is done using knockout it overrides the class assigned by wijmo. Hence dropping any fancy css along with it. I would like to append required to the class.
Knockout is using templates to assign the correct input from the database.
<script type="text/html" id="WijmoTextAreaControl"> <textarea rows="5" data-bind="wijtextbox: {}, value: Value, wijtooltip: {title: 'Tooltip should be linked to an observable'}, attr: {placeholder: DatabaseName.PlaceholdText, class: DatabaseName.class}" /> </script>the class: binding replaces the wijmo class with required. Is there anyway to append the class information to the binding.
最满意答案
对于assigninn类,你应该使用css绑定而不是attr 。
<textarea rows="5" data-bind="wijtextbox: {}, value: Value, wijtooltip: {title: 'Tooltip should be linked to an observable'}, attr: {placeholder: DatabaseName.PlaceholdText}, css: {'Your class name': true}" />You should use css binding instead of attr for assigninn class.
<textarea rows="5" data-bind="wijtextbox: {}, value: Value, wijtooltip: {title: 'Tooltip should be linked to an observable'}, attr: {placeholder: DatabaseName.PlaceholdText}, css: {'Your class name': true}" />更多推荐
wijmo,class,Knockout,required,using,电脑培训,计算机培训,IT培训"/> <meta name
发布评论