Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pooja297 opened this issue Aug 29, 2023 · 0 comments

Comments

@pooja297
Copy link

pooja297 commented Aug 29, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant