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

Grid update server response

1 Answer 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eduardo
Top achievements
Rank 1
Eduardo asked on 18 Sep 2016, 12:14 AM

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!

1 Answer, 1 is accepted

Sort by
0
Eduardo
Top achievements
Rank 1
answered on 18 Sep 2016, 09:20 PM

I changed

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

 

to

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

And it works perfectly.

Cheers!

Tags
Grid
Asked by
Eduardo
Top achievements
Rank 1
Answers by
Eduardo
Top achievements
Rank 1
Share this question
or