jQuery UI Widgets › Forums › Editors › DateTimeInput › jqxdate time integration with knock out validation
Tagged: data-bind, datetimeinput, jqxdatetimeinput, jqxvalidator, Knockout, Knockout Validation, validate, validation, validator
This topic contains 4 replies, has 2 voices, and was last updated by Dimitar 10 years, 10 months ago.
-
Author
-
Hey i am trying to integrate jqxdatetime with knock out, it is working fine . But when it comes to validating them it feels something i am missing, i did not saw any info about knock out validating with jqx controls.
<div id=’startDate’ data-bind=”jqxDateTimeInput: {value: StartDate,width: ‘230px’, height: ’25px’, showCalendarButton: true} ” >
</div>
<div id=’endDate’ data-bind=”jqxDateTimeInput: {value: EndDate,width: ‘230px’, height: ’25px’, showCalendarButton: true} “>
</div>
My validation rule:
ko.validation.rules[‘checkDate’] = {
validator: function (val, otherVal) {
otherVal = new Date(otherVal);
val = new Date(val);
return otherVal === val;},
message: ‘From date must be equal to date’
};Is this ok for validation or shall i have to add somthing at binding level??
and my model:
{
StartDate: ko.observable(getDate()),
EndDate: ko.observable(getDate()).extend({ checkDate: getDate() })
}Hello Aj_s,
Please note that the jqxValidator plug-in cannot be initialized though the data-bind attribute. You will need to initialize it as shown in its demo examples. This, however, does not mean it cannot work properly with Knockout-bound widgets initialized through data-bind.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimilitar thanx for your response!!
I am not using JqxValidator plug in for validating date time. I am using knock out validation as you can see. It s functionality working fine with Knock out databind, But failing to display error while validating. I can get error message in firebug but it is not getting display in DOM
Hello Aj_s,
Unfortunately, the Knockout Validation plug-in is not supported by jQWidgets.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.