This is a migrated thread and some comments may be shown as answers.

server side validation example

1 Answer 480 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 09 Sep 2014, 11:20 AM
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.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 11 Sep 2014, 09:05 AM
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!
 
Tags
Scheduler
Asked by
Paul
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or