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

Schedler Custom Editor Extra Field

1 Answer 150 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Senol
Top achievements
Rank 1
Senol asked on 24 Jan 2014, 01:32 PM
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. 



1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Jan 2014, 12:04 PM
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!
Tags
Scheduler
Asked by
Senol
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or