Data Source missing the Data property

3 posts, 1 answers
  1. AP
    AP avatar
    261 posts
    Member since:
    Apr 2010

    Posted 30 Jul 2013 Link to this post

    The scheduler implementation of the datasource differs from the usage in most of the other Kendo UI widgets.  It doesn't seem to have a data property, which can be used to pass parameters to the controller , to enable custom filtering to be done on the server.

    I would like to display two sets of data on one scheduler, and control what is displayed from a drop-down list. This is easy to accomplish with a grid e.g.:-
                    m.Id(p => p.LogID);
      <script type="text/javascript">
            var srch = 28;
            function selectionChange() {
                var dropdownlist = $("#loadDDL").data("kendoDropDownList");
                var dataItem = dropdownlist.dataItem();
                srch = dataItem.LoadID;
                //refresh Grid
        function srchLoad() {
            return {
                ID: srch

    However, I don't seem able to do this with the scheduler.  All I can see is a filter property, but since the data is coming from two different tables, handling the it this way is undesirable.

    Currently I have two scheduler widgets in a tab control, but this causes some display issues, and is a bit clunky.

  2. Answer
    Vladimir Iliev
    Vladimir Iliev avatar
    2206 posts

    Posted 01 Aug 2013 Link to this post

    Hi Andrew,

    Please note that the Scheduler supports such Data function which to return additional parameters to the server for custom filtering - please check the example below:

    1) Set the data function:

    .Read(read => read.Action("Read", "Scheduler").Data("getFilterParameters"))

    2) Create function which will return object that contains current Scheduler View start and end date:
    function getFilterParameters() {
        var startDate = new Date(2013, 5, 4);
        var endDate = new Date(2013, 5, 13);
        return { start: kendo.format("{0:G}", startDate), end: kendo.format("{0:G}", endDate) };

    3) Update the controller to accept the new start and end parameters and filter the data:
    public virtual JsonResult Read([DataSourceRequest] DataSourceRequest request, DateTime? start, DateTime? end)
        if (start != null && end != null)
            var filteredResult = taskService.GetAll().Where<TaskViewModel>(a => a.Start >= start && a.End >= end).Select(a => a);
            return Json(filteredResult.ToDataSourceResult(request));
        return Json(taskService.GetAll().ToDataSourceResult(request));
    Kind Regards,
    Vladimir Iliev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. AP
    AP avatar
    261 posts
    Member since:
    Apr 2010

    Posted 02 Aug 2013 Link to this post

    Thanks, I'm not sure why I couldn't get it to work before.
Back to Top