We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Some help with custom window

Hello,

Im not expert in MVC as of yet and im trying to create a custom window with validation, IM having a problem with the Window not rendering when entering and appointment. In particular i think this line might be an issue

.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Calendar/GetData").CrudURL("/Calendar/Batch").Adaptor("UrlAdaptor"))

If i write it like below i get compilation errors even the solution builds

.AppointmentSettings(fields => fields.Datasource(ViewBag.dataSource),(ds => ds.URL("/Calendar/GetData").CrudURL("/Calendar/Batch").Adaptor("UrlAdaptor"))

Anyway i have added my project below for you to take a look at.

https://www.dropbox.com/s/lq2mlbr0sr90ig0/ELHTResourcingv2.rar?dl=0

Thanks

Simon



3 Replies

MP Mahesh Palanisamy Syncfusion Team July 11, 2016 01:28 PM UTC

Hi Simon, 

Thank you for contacting Syncfusion support.  

We have prepared the sample for your requirement “create a custom window with validation” which can be downloaded from the following location: 

In the above sample we have used the following code to bind data source to schedule – which calls the appropriate server actions. 

<Code> 
@(Html.EJ().Schedule("Schedule1") 
        .Width("100%") 
        .Height("525px") 
        .CurrentDate(new DateTime(2015, 11, 10)) 
            .AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor")) 
            .Id("Id") 
            .Subject("Subject") 
            .StartTime("StartTime") 
            .EndTime("EndTime") 
            .Description("Description") 
            .AllDay("AllDay") 
            .Recurrence("Recurrence") 
            .RecurrenceRule("RecurrenceRule")) 
        .ScheduleClientSideEvents(evt => evt.AppointmentWindowOpen("onAppointmentWindowOpen")) 
) 

</Code> 

Kindly refer the sample and let us know, if you need any further assistance on this. 

Regards, 
Mahesh 



SR Simon Roberts July 11, 2016 02:34 PM UTC

Ive changed my solution slightly and i just cant get the appointment window to render, If i double click or press edit appointment in the mini window my custom window does not render.


SE Sellakumar Syncfusion Team July 12, 2016 04:50 PM UTC

Hi Simon,  
 
Thanks for your update. 
 
We have analyzed your previously provided project further and suspect that the script section are not rendered properly in it, so that it might cause such issue(The custom window is not opened). Please make the below changes as highlighted in your project. 
 
In _Layout.cshtml, we need to render the script section. The code block is as follows: 
 
<code> 
 
    @Scripts.Render("~/bundles/jquery") 
    @Scripts.Render("~/bundles/bootstrap") 
    @Scripts.Render("~/Scripts/jquery.easing.1.3.js") 
    @Scripts.Render("~/Scripts/jsrender.min.js") 
    @Scripts.Render("~/Scripts/ej/web/ej.web.all.min.js") 
    @RenderSection("scripts", required: false) 
    @RenderSection("ScriptSection", required: false) // add this scriptSection 
    @Html.EJ().ScriptManager() 
 
</code> 

In View page, need to define the script section. The code block is as follows: 

<code> 

@section ScriptSection{ 
 
<script> 
 
        var Owners = [ 
            { text: "Nancy", id: 1, groupId: 1, color: "#ffaa00" }, 
            { text: "Steven", id: 3, groupId: 2, color: "#f8a398" }, 
            { text: "Michael", id: 5, groupId: 1, color: "#7499e1" } 
        ]; 
------------------- 
        function cancel() { 
            clearFields(); 
            $("#customWindow").ejDialog("close"); 
        }    
 
</script> 
 
} 

</code> 

Kindly try out our above suggestion and let us know, if it solves your reported problem and also let us know, if you need any further assistance on this. 
 
Regards, 
Sellakumar K

Loader.
Live Chat Icon For mobile
Up arrow icon