Grid update server response

2 posts, 0 answers
  1. Eduardo
    Eduardo avatar
    3 posts
    Member since:
    Aug 2016

    Posted 17 Sep Link to this post

    Hello All,

    I've seen questions like this several times and based on the answers, I think I'm doing everything right and even so it's not working.

    My grid invokes the remote update method ok, and the server receives the requirement as expected. It executes the code perfectly. I'm using popup edit and the problem is the edit window never closes. It remains there. I receive no error message either from the grid control, the server or jquery/javascript.

    The response I'm sending is the following:

    Response HTTP/1.1 200 OK
    Content-Length 110
    Content-Type application/json; charset=utf-8
    Server Microsoft-HTTPAPI/2.0
    Access-Control-Allow-Origin *
    Access-Control-Allow-Methods GET, POST, PUT, DELETE
    Date Sun, 18 Sep 2016 00:01:57 GMT
    [{"firstName":"XXX","lastName":"YYY","number":666,"role":0,"roleDescription":"User"}]

     

    The grid definition follows:

    $(document).ready(function () {
    $("#userGrid").kendoGrid({
    dataSource: {
    type: "jsonp",
    transport: {
    read: "<%=ConfigurationManager.AppSettings["wsbase"]%>/getuserlist",
    update: {
    url: "<%=ConfigurationManager.AppSettings["wsbase"]%>/updateuser",
    dataType: "jsonp",
    type: "get",
    },
     error: function (e) {
    if (e.errors) {
    alert(e.errors);
    this.cancelChanges();
    }
     },
    },
                schema: {
                   model: {
                      id: "number",
                      fields: {
                         number: { type: "number", editable: false },
                         firstName: { type: "string", editable: false },
                         lastName: { type: "string", editable: false },
                         role: { type: "number", validation: {min: 0, max: 3, required: true} },
                         roleDescription: { type: "string", editable: false }
                      }
                   }
                }
    },
    pageable: false,
    height: 350,
    toolbar: ["create"],
    columns: [
    { field: "number", title: "Número" },
                { field: "firstName", title: "Nombre"},
                { field: "lastName", title: "Apellido"},
                { field: "role", title: "Cód. Perfil"},
                { field: "roleDescription", title: "Perfil"},
                { command: ["destroy", "edit"], title: "Opciones"}],
    editable: "popup"
    });
    });

     

    Any help, VERY WELCOMED!

  2. Eduardo
    Eduardo avatar
    3 posts
    Member since:
    Aug 2016

    Posted 18 Sep in reply to Eduardo Link to this post

    I changed

    update: {
    url: "<%=ConfigurationManager.AppSettings["wsbase"]%>/updateuser",
    dataType: "jsonp",
    type: "get",
    },

     

    to

    update: "<%=ConfigurationManager.AppSettings["wsbase"]%>/updateuser",

    And it works perfectly.

    Cheers!

  3. Kendo UI is VS 2017 Ready
Back to Top