4

After giving an update via ajax in jsgrid the line returns blank

controller: {
    loadData: function(filter) {
        var data = $.Deferred();
        $.ajax({
            type: "GET",
            contentType: "application/json; charset=utf-8",
            url: "/app/Play/",
            dataType: "json"
        }).done(function(response) {
            data.resolve(response);
        });
        return data.promise();
    },
    updateItem: function(item) {
        return $.ajax({
            type: "POST",
            url: "/app/Play/change.php",
            data: item,
        });
    },
}

In the return of the url update: /app/Play/change.php

I return the updated record data in a normal json, same as the initial json used in the load

Narendra Jadhav
  • 10,052
  • 15
  • 33
  • 44
sNniffer
  • 210
  • 2
  • 19

1 Answers1

1

Resolved:

controller: {
    loadData: function(filter) {
        var data = $.Deferred();
        $.ajax({
            type: "GET",
            contentType: "application/json; charset=utf-8",
            url: "/app/Jogos/app/",
            data: filter, // <--Insert line, this is a problem
            dataType: "json"
        }).done(function(response) {
            data.resolve(response);
        });
        return data.promise();
    },
    updateItem: function(item) {
        return $.ajax({
            type: "POST",
            url: "/app/Jogos/app/change.php",
            data: item
        });
    },
},
Narendra Jadhav
  • 10,052
  • 15
  • 33
  • 44
sNniffer
  • 210
  • 2
  • 19
  • A good answer has a better explanation. Please explain how you resolved issue? – Narendra Jadhav Sep 25 '18 at 04:43
  • For me the problem was that the JSON response was pascalCase instead of CamelCase (.NET Core Problem..). I then switched the default settings to camelCase – Bluesight Feb 28 '19 at 12:07