tabalinas / jsgrid

Lightweight Grid jQuery Plugin
http://js-grid.com
MIT License
1.53k stars 353 forks source link

Help needed with JsGrid loadData function after I upgraded an old project to .net 7.0 #1430

Open pooja297 opened 10 months ago

pooja297 commented 10 months ago

@tabalinas If you can please help me with this issue

  1. This is my function call

`

    var myData = {
    loadData: function (filter) {
    $("#someGrid").show();

      var d = $.Deferred();
      $.ajax({
          type: "GET",
          url: "/TableMaintenance/GetData?id=null&productId=" + ProductId() + "&TypeId=" + TypeId(),
          dataType: "json",
          data: filter
      }).done(function (response) {
          if (response.success) {
              d.resolve(response.data);
              myData.data = response.data;
          } else {

              alert("error: " + response.error);
              $('#ItemCount').text('Your search failed');
          }
      }).fail(function(xhr) {

          var errMsg = 'Your search failed';

          alert(errMsg);
      });
      return d.promise();} }`
  1. I just upgraded my project from .net coreapp2.2 to .net 7.0. I made all the required changes for the upgrade including the packages
  2. My api call looks like this with the filter data that i am sending: http://localhost:5003/TableMaintenance/GameData?id=null&productId=&TypeId=&Type=&SubType=&ERA=&Variation=&Name=&MyData%20ID=&MyData%20Status=&DevTrack%20ID=
  3. the above API call is returning data in this format which is the correct format { "success": true, "data": [ { "id": 117924, "myDataId": 4428, "productId": 53, "TypeId": 479, "subTypeId": 3522, "EraId": 640, "variationId": 4053, "statusId": 0, "devTrackId": null, "issueDate": "0001-01-01T00:00:00", } ] }
  4. But my expected return format (that it was returning before the upgrade to .net 7.0 was done) is: { "success": true, "data": [ { "id": 362590, "GAC": 9672, "Product": "something", "Type": "tall", "SubType": "hello", "ERA": "", "Variation": "0", "MyData ID": 1001, "MyData Status": null, "DevTrack ID": null, "Exported": false, "Sync": true, "Deleted": false, "Name": "Hello Word", "Description": null, "DisplayName": null, "Active": true },

Now, with the .net 2.2, the API return data from step 4 was shown as step 5 in the jsGrid response.data and hence i was able to load my grid with that value but after the upgrade, the jsGrid response shows the raw data only and it is not formatting in the way it was doing before It does not look like the api issue because API is still returning the data as it is supposed to but jsGrid is not formatting it in the way that it was doing before