English 中文(简体)
如何在RadStoruler之前验证任用
原标题:How to validate appointment before RadScheduler inserting

I have a problem with RadScheduler. I need to validate double clicked time slot for availability before insert form opens. I using advanced insert form. Unfortunately its no OnAppointmentInserting or like event like this. I found OnClientAppointmentInserting event, and i can use it for validation, but i can not continue to insert form if validation is correct. Following the code i use for client side validation, but its no way to show insert form after validation:

function beforeInserting(s, e) {
        var url =   ;
        var requestUrl = window.location.href.toLowerCase();
        if (requestUrl.indexOf( /views/ ) != -1)
            url = requestUrl.substring(0, requestUrl.indexOf( /views/ )) +  /jobservice.svc/IsTimeAvailable?userId=0 ;
        e.set_cancel(true);
        var app = e.get_targetSlot();

        $.ajax({
            url: url,
            accepts:  application/json, text/javascript, */* ,
            cache: false,
            success: function (r) {
                if (r !=   ) {
                    alert(r);
                    return;
                }
                else {
                    var scheduler = $find("<%= rdJobScheduler.ClientID %>");
                    var newApp = new Telerik.Web.UI.SchedulerAppointment();

                    newApp.set_start(app.get_startTime());
                    newApp.set_end(app.get_endTime());

                    // This is not working properly it just send OnInserted event to server
                    // scheduler.insertAppointment(newApp);
                }
            },
            error: function (err, text, xhr) {
                alert(text);
            }
        });
    }
问题回答

请看The Knowledge Base article of Telerik to see how to preventing of 任命。 只有在任命的主题空洞的情况下,你才能加入任命。 你们可以使用自己的鉴定方法。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签