Scheduler CRUD ops all want to use 'GET' type

7 posts, 0 answers
  1. Michael
    Michael avatar
    24 posts
    Member since:
    Jan 2016

    Posted 26 Aug 2016 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
    24 posts
    Member since:
    Jan 2016

    Posted 29 Aug 2016 Link to this post

  3. Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 30 Aug 2016 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.
  4. Michael
    Michael avatar
    24 posts
    Member since:
    Jan 2016

    Posted 30 Aug 2016 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;


  5. Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 01 Sep 2016 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.
  6. Fevzi
    Fevzi avatar
    3 posts
    Member since:
    Jun 2012

    Posted 18 Mar 2019 in reply to Michael Link to this post


    public Int16 EventUpdate([FromBody]vw_Events_GetAll model)

    In the method header you use a model type of ww_Events_GetAll. How on earth, the method can understand what that is. Whre is it defined? I fit is a type defined corresponding to the Event properties, it does not work.

    Could you please clarify?




  7. Joana
    Joana avatar
    210 posts

    Posted 19 Mar 2019 Link to this post

    Hi Fevzi,

    The type of result is retrieved by the dataType dataSource configuration option. You could find more information in the following link:

    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.
Back to Top