This is a migrated thread and some comments may be shown as answers.
KendoUI Scheduler Configuration
1 Answer 20 Views
This is a migrated thread and some comments may be shown as answers.
T
Top achievements
Rank 1
T asked on 12 Feb 2014, 03:21 PM
Hi, I am a beginner with Kendo generally and I'm trying to implement the scheduler control to show live calculation of material usage on daily bases (in a week by week view). 

I am unable to have the Usage data displayed in the cells although I managed to have to Materials displayed on the left hand side. I wonder if any one could help or give me some hints on what I am doing wrong. Here is my code so far:

I can be sure that data is being return to the view but the view is not showing the usage data, which is simply numeric values corresponding to a material on a specific day of the week. I have also attached a screenshot of how it looks like:

the Controller method to read the data: 

        public JsonResult Read([DataSourceRequest] DataSourceRequest request)
        {
            try
            {
                var usageList = new List<ReportUsageViewModel>();

                var imports = _importRespository.GetImports();

                foreach (var usageReportStoredProcedure in imports)
                {
                    var usageViewModel = new ReportUsageViewModel();

                    usageViewModel.MaterialID = usageReportStoredProcedure.MaterialID;
                    usageViewModel.Start = usageReportStoredProcedure.ScanDate;
                    usageViewModel.End = usageReportStoredProcedure.ScanDate;
                    usageViewModel.DailyUsage = usageReportStoredProcedure.UsageQuantity;
                    usageViewModel.Title = usageReportStoredProcedure.UsageQuantity.ToString();

                    usageList.Add(usageViewModel);
                }


                return Json(usageList.ToDataSourceResult(request));

            }
            catch (Exception exc)
            {
                ErrorHelper.WriteToEventLog(exc);
                return null;
               
            }
            
            
        }


The actual control

<div id="StockViewer">
    @(Html.Kendo().Scheduler<WorcesterMarble.ViewModels.ReportUsageViewModel>()
    .Name("StockViewer")
    .Timezone("Europe/London")
    .Resources(resource => resource.Add(m => m.MaterialID)
        .Title("Materials")
        .Name("Materials")
        .DataTextField("Name")
        .DataValueField("MaterialID")
        .BindTo(Model.MaertiaList))
    .MajorTick(270)
    .MinorTickCount(1)

    .StartTime(DateTime.Now.Date.AddHours(8))
    .EndTime(DateTime.Now.Date.AddHours(17))
    .AllDaySlot(false)
    .Date(DateTime.Now.Date)
    .Editable(false)
    .Views(x => x.WeekView(v =>
    {
        v.Footer(false);
        v.Selected(true);
        v.DateHeaderTemplate("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd/M')#</span>");
    }))
    .Group(group => group.Resources("Materials").Orientation(SchedulerGroupOrientation.Vertical))
        .DataSource(d => d
        .Model(m => {
            m.Id(f => f.MaterialID);
            m.Field(f => f.Title).DefaultValue("No title"); 
        })
        .Read("Read", "ReportUsage")
    )
    )
















1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 17 Feb 2014, 08:05 AM
Hi,

From the provided information it's not clear for us what is the exact reason for the events not being loaded on the client side - could you please provide runable example where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
T
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or