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

Kendo grid update working locally but not on server

4 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Dec 2016, 01:36 PM

This is a bizarre issue - I have a grid that works just fine locally for dev but once I publish it to our web server with IIS 7/8 (maybe?) it's not working in any browser. If you weren't go go back and check the data, it would appear as it's working. I receive no console errors, no issues while checking the network tab. When I put a breakpoint in the parametermap , I can clearly see the model data is there with the updated data. I haven't checked insert on the server yet but I can tell you that Update isn't working. I'm not using delete. Read has no issues.

The first part of my web api declaration for this action.

[HttpPost]
       [Route("Users/InsertUser")]
       public Int16 InsertUser([FromBody]IEnumerable<vw_Users_GetAll> model)

 

And the portion of code for the grid...

 

var crudServiceBaseUrl = getBaseURL(),
            dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: function (options) {
                            return crudServiceBaseUrl + 'api/Users';
                        },
                        dataType: "json",
                        type: 'GET',
                        contentType: 'application/json; charset=utf-8'
                    },
                    create: {
                        url: function (options) {
                            return crudServiceBaseUrl + 'Users/InsertUser';
                        },
                        dataType: "json",
                        type: 'POST',
                        contentType: 'application/json; charset=utf-8',
                        complete: function (e) {
                            ReloadUsersGrid();
                        }
 
                    },
                    update: {
                        url: function (options) {
                            return crudServiceBaseUrl + "Users/UpdateUser"
                        },
                        dataType: "json",
                        type: "PUT",
                        contentType: "application/json; charset=utf-8",
                        complete: function (e) {
                            ReloadUsersGrid();
                        }
                    },
                    parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                                return kendo.stringify(options.models);
                        }
                    }
                },
                batch: true,

 

I don't understand how this can work locally but not on the server? Can someone please assist? Thanks.

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 07 Dec 2016, 10:12 AM
Hello Michael,

This is not a known issue and it was not reproduced in our testing scenarios.

Could you please confirm if the parameters are correctly sent to the server by checking the network tab in the browser developers tools? This will help us locating the issue.

As the issue occurs only on the web server, is there an option to host it and provide a live URL so we can investigate the example?

Also, the code behind the ReloadUsersGrid() function will be helpful.

Thank you in advance.

Regards,
Stefan
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Michael
Top achievements
Rank 1
answered on 08 Dec 2016, 01:16 PM
ReloadUsersGrid() - I added this simply to refresh/redraw the grid after an insert/update. I commented this out to try and see what's going on and it hasn't helped, there or not.

In the network tab I get a 200 OK status. I looked at the model going over, seems fine. I am noticing I am getting a 0 response however. In my Stored proc, I'm returning a -1 if there's an error. And to add on to that, I was running a trace on SQL and the insert/update methods aren't even being called. I have to conclude it's not even hitting the DB and that it must not even be reaching the controller action. 

What would cause it to hit the controller action just fine locally but not on the server? I even added a e.preventDefault() on the save of the grid and I tried to reach the controller manually with a .ajax call, while passing the model over that way - still not reaching it. So I'm wondering if this even a Kendo issue. But any ideas would be greatly appreciated anyways.
0
Michael
Top achievements
Rank 1
answered on 08 Dec 2016, 03:37 PM
Update. I'm able to reach the controller. I think this is a non-kendo issue and more something with the DB.
0
Stefan
Telerik team
answered on 12 Dec 2016, 08:07 AM
Hello Michael,

I'm glad to hear that there is an improvement with the issue.

From the provided information I can assume that indeed the issue is not related to Kendo UI. Still if after additional research the issue is related to the Kendo UI Grid, please let me know and I will gladly assist.

Regards,
Stefan
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Michael
Top achievements
Rank 1
Share this question
or