Scheduler CRUD ops all want to use 'GET' type

5 posts, 0 answers
  1. Michael
    Michael avatar
    20 posts
    Member since:
    Jan 2016

    Posted 26 Aug Link to this post

    I'm having an issue with an instance of the kendoScheduler. What's going on is, all crud operations, in addition to read, seem to want to use the 'get' type. I'm using the code from the demo on this site. So I figured, OK, I'll just add in the type: 'put', say for for update method. Still doesn't work.

    On the other side of things, I'm using web api and I have all my different actions in the controllers, say, we're dealing with the update one only here - I have the [httpPut] attribute on top of the action. And I'm getting the 405 method not allowed error. 

    Playing around, on the client side of things, I changed the updates type, to get, and add [httpGet] to the controller (even though this clearly isn't what I want here) - when I debug this, it finds the respective action, but the model is null.

    What's going on when I have httpput on the controller and why on the front end is all crud operations trying to use a get?



  2. Michael
    Michael avatar
    20 posts
    Member since:
    Jan 2016

    Posted 29 Aug Link to this post

  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Georgi Krustev avatar
    3706 posts

    Posted 30 Aug Link to this post

    Hello Michael,

    The guaranteed response time for forum threads is 48 hours (Mon-Fri). The record of this thread shows that the response time is in the promised range.

    With regards to the question, the DataSource component (used by the Scheduler), will request the data using GET action by default. If you would like to modify that behavior, then just set the transport.[method].type value:

    Based on the given details, it seems that you have already changed those properties, but I am afraid that it is not clear what exactly happens. Probably, you will need to modify the format of the send models in order to receive them on the server:

    If the problem still persists, please send us a simplified repro demo, which we can debug locally.

    Georgi Krustev
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  5. Michael
    Michael avatar
    20 posts
    Member since:
    Jan 2016

    Posted 30 Aug in reply to Georgi Krustev Link to this post

    I sincerely apologize about the response time.

    Let me show you some code...

    Here's the front end.

    01.<div id="calEventSchedule"></div>
    03.            <script>
    04.            $(function() {
    05.                $("#calEventSchedule").kendoScheduler({
    06.                    date: new Date("2016/8/25"),
    07.                    startTime: new Date("2016/8/25 07:00 AM"),
    08.                    height: 600,
    10.                        "day",
    11.                        "week",
    12.                        { type: "month", selected: true }
    13.                    ],
    14.                    timezone: "Etc/UTC",
    15.                    dataSource: {
    16.                        batch: true,
    17.                        transport: {
    18.                            read: {
    19.                                url: baseURL + "api/events",
    20.                                dataType: "jsonp",
    21.                                type: "GET",
    22.                                contentType: 'application/json; charset=utf-8'
    23.                            },
    24.                            update: {
    25.                                url: baseURL + "Events/EventUpdate",
    26.                                dataType: "jsonp",
    27.                                type: "PUT",
    28.                                contentType: 'application/json; charset=utf-8'
    29.                            },
    30.                            create: {
    31.                                url: baseURL + "Events/InsertEvent",
    32.                                dataType: "jsonp",
    33.                                type: "POST",
    34.                                contentType: 'application/json; charset=utf-8'
    35.                            },
    36.                            destroy: {
    37.                                url: baseURL + "Events/DeleteEvent",
    38.                                dataType: "jsonp",
    39.                                type: "DELETE",
    40.                                contentType: 'application/json; charset=utf-8'
    41.                            },
    42.                            parameterMap: function(options, operation) {
    43.                                if (operation !== "read" && options.models) {
    44.                                    return {models: kendo.stringify(options.models)};
    45.                                }
    46.                            }
    47.                        },
    48.                        schema: {
    49.                            model: {
    50.                                id: "taskId",
    51.                                fields: {
    52.                                    taskId: { from: "taskId", type: "number" },
    53.                                    title: { from: "title", defaultValue: "No title", validation: { required: true } },
    54.                                    start: { type: "date", from: "start" },
    55.                                    end: { type: "date", from: "end" },
    56.                                    startTimezone: { from: "startTimezone" },
    57.                                    endTimezone: { from: "endTimezone" },
    58.                                    description: { from: "description" },
    59.                                    recurrenceRule: { from: "recurrenceRule" },
    60.                                    isAllDay: { type: "boolean", from: "isAllday" }
    61.                                }
    62.                            }
    63.                        }
    64.                    }
    65.                });
    67.            });
    68.            </script>

    And and example of the PUT action in the web api controller...

            // PUT: edit a event
            public Int16 EventUpdate([FromBody]vw_Events_GetAll model)

                Int16 eventresult = 0;

                string _title = model.title;
                DateTime _start = (DateTime)model.start;
                DateTime _end = (DateTime)model.end;
                string _startTimezone = model.startTimezone;
                string _endTimezone = model.endTimezone;
                string _description = model.description;
                string _recurrenceRule = model.recurrenceRule;
                Boolean _isAllday = (Boolean)model.isAllday;
                Int32 _taskId = model.taskId;

                    var result = db.spEventsUpdate(_title, _start, _end, _startTimezone, _endTimezone, _description, _recurrenceRule, _isAllday, _taskId);

                    foreach (var key in result)
                        eventresult = Convert.ToInt16(key.taskId);
                catch (Exception e)
                    Console.WriteLine("Error: " + e);
                    //really should write to db

                return eventresult;


  6. Georgi Krustev
    Georgi Krustev avatar
    3706 posts

    Posted 01 Sep Link to this post

    Hello Michael,

    JSONP supports only GET method. If you need to use PUT, POST and etc, then you will need to switch to JSON data type. The easiest solution is to use proxy server.

    You can check this extensive StackOverflow answer devoted on the same subject:

    Georgi Krustev
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top
Kendo UI is VS 2017 Ready