Creating a razor template for event creation

2 posts, 0 answers
  1. alex
    alex avatar
    5 posts
    Member since:
    Aug 2013

    Posted 02 Jan 2014 Link to this post

    I have a requirement to override the existing window to add an event as we have additional field we would like to display. The Template open correctly and populates the standard scheduler columns. However before opening the window I need to call our server to get a list of event types and a list of member (or possible members). 

    or index.cshtml looks like this

                      .Views(views =>
                                    views.DayView(dayView => dayView.Selected(true));
                       .DataSource(d => d
                            .Model(m => m.Id(f => f.EventId))
                            .Read(u => u.Action("Read", "Calendar"))
                            .Update(u => u.Action("Update", "Calendar").Data("serialize"))
                            .Create(c => c.Action("Create", "Calendar").Data("serialize"))
                            .Destroy(delete => delete.Action("Delete","Calendar"))
                        .Editable(e => e.TemplateName("CalendarEditor"))

    I thought that the .Read(u => u.Action("Read", "Calendar")) would fire the read function before the template is displayed.

    How do I fire an event on open of the new template?


  2. Georgi Krustev
    Georgi Krustev avatar
    3689 posts

    Posted 06 Jan 2014 Link to this post

    Hello Damion,

    I would suggest you check this code library, which shows how to define a custom editor. In general, the fields will be populated if the correct bindings are added (value binding points to a specific model property).

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top