Schedler Custom Editor Extra Field

2 posts, 0 answers
  1. Senol
    Senol avatar
    11 posts
    Member since:
    Feb 2013

    Posted 24 Jan 2014 Link to this post

    http://www.kendoui.com/code-library/mvc/mvc/scheduler/custom-editor.aspx

    Hi everyone,
    I want to create custom editor which is given above link. However, I want to add extra fields from my tablo this custom editor. Although I add extra fields such as example codes at below;

    //extra field
      public int ZTip { get; set; }

    //Schedler
     @(Html.Kendo().Scheduler<ZiyaretHareketleri>()
        .Name("scheduler")
        .Date(new DateTime(2014, 1, 20))
        .StartTime(new DateTime(2014, 1, 20, 7, 00, 00))
            //.Height(600)
        .AllDaySlot(false)  
           .Editable(e =>
               {             
                   e.TemplateName("CustomEditorTemplate");
               })
        .Views(views =>
        {
            views.DayView(d => d.Footer(false));
            views.WeekView(WeekView =>
            {
                WeekView.Selected(true);
                WeekView.Footer(false);
            });
            views.MonthView();
            views.AgendaView();
        })
        .Timezone("Etc/UTC")
        .Group(group => group.Resources("Attendees").Orientation(SchedulerGroupOrientation.Vertical))
                 .Resources(resource => resource.Add(m => m.OwnerID)
                                                .Title("Kullanıcılar")
                                                .Name("Attendees")
                                                .DataTextField("Name")
                                                .DataValueField("UserId")
                                                .DataColorField("Colour")
                                                .DataSource(ds => ds.Read("GetKullanici", "Home"))
                                              
                                                )
        .DataSource(d => d
            .Model(m =>
            {
                m.Id(f => f.TaskID);
                m.Field(f => f.Title).DefaultValue("Yeni Ziyaret");
                m.Field(f => f.OwnerID).DefaultValue(1);
                m.Field(f => f.Start);
                m.Field(f => f.End);
                m.Field(f => f.Description);
                m.Field(f => f.IsAllDay);
                m.Field(f=>f.ZTip); // Extra Field
                
            })
            .ServerOperation(true)
           .Read(read => read.Action("Read", "Home").Data("filterData"))
            .Create("Create", "Home")
            .Destroy("Destroy", "Home")
            .Update("Update", "Home")

        )
          )

    //Custom Editor
    <div data-container-for="ZTip" class="k-edit-field">
        @(Html.TextBoxFor(model => model.ZTip, new { @class = "k-textbox", data_bind = "value:ZTip" }))
    </div>

    always I have been getting zero value from input. 



  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 28 Jan 2014 Link to this post

    Hello,

    The code looks correct. Is the field value set in the data that is loaded from the server? If yes, then could you check the attached modified code library project and let me know if I am missing something?

    Regards,
    Daniel
    Telerik
    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 MVC is VS 2017 Ready
Back to Top