jQuery UI Widgets Forums Editors DateTimeInput jqxdate time integration with knock out validation

This topic contains 4 replies, has 2 voices, and was last updated by  Dimitar 9 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • Aj_s
    Participant

    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??


    Aj_s
    Participant

    and my model:
    {
    StartDate: ko.observable(getDate()),
    EndDate: ko.observable(getDate()).extend({ checkDate: getDate() })
    }


    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Aj_s
    Participant

    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


    Dimitar
    Participant

    Hello Aj_s,

    Unfortunately, the Knockout Validation plug-in is not supported by jQWidgets.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.