server side validation example

2 posts, 0 answers
  1. Paul
    Paul avatar
    24 posts
    Member since:
    Aug 2013

    Posted 09 Sep 2014 Link to this post

    I'm trying to find an example of using server-side validation with scheduler.

    All I can find is examples on using it with the grid, but the set up is very different so it's unclear how to adapt it.

    In particular, the validation on grid examples I've found all do things like this:

    function showMessage(container, name, errors) {
            //add the validation message to the form
            container.find("[data-valmsg-for=" + name + "],[data-val-msg-for=" + name + "]")
            .replaceWith(validationMessageTmpl({ field: name, message: errors[0] }))
        }
    Yet there is no field with attribute 'data-valmsg-for' by default, so this will not work unless I manually insert one, yet there is no example of how this should be laid out.

    When using client side validation, an error field is automatically added which looks like this:

    <div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" style="margin: 0.5em; display: block;" data-for="last_name" role="alert"><span class="k-icon k-warning"> </span>last_name is required<div class="k-callout k-callout-n"></div>
    But again this doesn't exist pre-error.

    How can I hook these two things together?

    Cheers, Paul.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 11 Sep 2014 Link to this post

    Hello Paul,

    I would suggest you use the Model field validation option to define your custom validation rule. Inspired by this blog post, I created a simple Dojo demo, which demonstrates how to implement remote validation in Scheduler. Check it and me know if I can be of any further assistance.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top