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

Getting started

5 Answers 258 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Randy Hompesch
Top achievements
Rank 1
Randy Hompesch asked on 20 Sep 2019, 06:31 AM

I find myself having a heck of a time getting started with the scheduler. Is there a SIMPLE getting started example that explains how to use the scheduler? All I am looking to do is to have a monthly view and be able to display availability of items. An item could be, for example, a room at a hotel. I won't be doing anything more granular than day level scheduling. I want to block out a date on the calendar for an item. That's it. Once I can figure out how to do that, I can dig deeper myself.

Any guidance would be greatly appreciated.

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Sep 2019, 05:51 AM

Hello Randy Hompesch,

In terms of documentation for the Scheduler ASP.NET Core HtmlHelper usage, you could refer to the following resources:

All of the above examples have corresponding demos here:

In terms of getting started, and basic configuration of the widget, I would suggest referring to the Basic Usage Demo. In a bit more details, the key things to get you started are:

1) Create a Model that inherits from the ISchedulerEvent interface. An example could be observed in the above Dojo by scrolling below the example and clicking on the different file names:

public class TaskViewModel : ISchedulerEvent
{
  ...
}

2) Configure the widget in the desired view through the HtmlHelper by specifying the DataSource. The DataSource is responsible for sending CRUD requests to the server:

@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2013, 6, 13))
    .StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
    .Height(600)
    .Views(views =>
    {        
        views.MonthView();     
    })
    .Timezone("Etc/UTC")   
    .DataSource(d => d      
        .Model(m =>
        {
            m.Id(f => f.TaskID);
            m.Field(f => f.Title).DefaultValue("No title");
            m.Field(f => f.OwnerID).DefaultValue(1);
            m.RecurrenceId(f => f.RecurrenceID);
        })
        .Read("Read", "Scheduler")
        .Create("Create", "Scheduler")
        .Destroy("Destroy", "Scheduler")
        .Update("Update", "Scheduler")       
    )
)

3) Create the remote-end points for CRUD:

public virtual JsonResult Read([DataSourceRequest] DataSourceRequest request)
{
  return Json(taskService.GetAll().ToDataSourceResult(request));
}

public virtual JsonResult Destroy([DataSourceRequest] DataSourceRequest request, TaskViewModel task)
{
  if (ModelState.IsValid)
  {
    taskService.Delete(task, ModelState);
  }

  return Json(new[] { task }.ToDataSourceResult(request, ModelState));
}

public virtual JsonResult Create([DataSourceRequest] DataSourceRequest request, TaskViewModel task)
{
  if (ModelState.IsValid)
  {
    taskService.Insert(task, ModelState);
  }

  return Json(new[] { task }.ToDataSourceResult(request, ModelState));
}

public virtual JsonResult Update([DataSourceRequest] DataSourceRequest request, TaskViewModel task)
{            
   if (ModelState.IsValid)
  {
    taskService.Update(task, ModelState);
  }

  return Json(new[] { task }.ToDataSourceResult(request, ModelState));
}

The above could help you get started with the basic configuration and from there you could start exploring the different options through the Scheduler API:

In terms of the more-specific questions regarding blocking a date - could you elaborate a bit more if you would like to block a date and prevent editing events on that date, or just want to mark a slot where no events could be added?

I am looking forward to hearing from you.

Regards,


Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
1
Petter
Top achievements
Rank 1
answered on 20 Dec 2019, 03:59 PM

In other words: the answer was not so simple.

Where do I find implementations of the classes SchedulerTaskService, BaseService, SampleEntitiesDataContext and related required stuff, if needed? Is there a simple working project we can download that contains all dependencies?

1
Petter
Top achievements
Rank 1
answered on 20 Dec 2019, 04:18 PM
Hm. Never mind. I will just add my own insert/update/delete handling of the TaskViewModel to my database context. I suggest making some of this more obvious in the docs.
0
Dimitar
Telerik team
answered on 23 Dec 2019, 12:42 PM

Hello Peter,

You could review a sample implementation of the Read, Create, Update and Destroy end-points in the following documentation article:

Also, you could review the official Scheduler Demos for ASP.NET Core as they also have the source code available in tabs below the actual demo:

In addition to the above, the entire demos site is available as a local project inside the installation folder of Telerik UI for ASP.NET Core:

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Fernando
Top achievements
Rank 2
commented on 13 Jun 2023, 01:55 AM

Hi Dimitar. 4 years later...

The OP is probably new to ASP.NET Core, like I am. For us noobs, the samples are very short on detail as to how to put one of them together inside Visual Studio. Ideally, it would have been far easier to provide an entire VS download of the demos, complete with Solution file, resources and data sources too - even minimalist versions of the data as an example. Trying to put together an entire VS project using your tools is not easy to say the least.

0
Stoyan
Telerik team
answered on 15 Jun 2023, 02:09 PM

Hello guys,

I am happy to let you know that we have an ongoing effort to write Getting Started articles for our Components to decrease the learning curve for newcomers.

Such an article is already available for the Scheduler. Refer to it here: https://docs.telerik.com/aspnet-core/html-helpers/scheduling/scheduler/getting-started-scheduler

Finally, please don't hesitate to let us know of your feedback. Thank you.

Regards,
Stoyan
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Tags
Scheduler
Asked by
Randy Hompesch
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Petter
Top achievements
Rank 1
Stoyan
Telerik team
Share this question
or