Paramquery: Multiple grids on same page not updating

486 Views Asked by At

So I have a primary pqgrid object on the main page and on editing one of the rows, a jquery popup appears with the data corresponding to that row which includes few text fields and another pqgrid.

The first time I click edit, the inner grid is loaded correctly with the correct data. But upon closing the dialog and editing a different row, the grid loads up empty without any data.

In order to debug, this is how my getData of dataModel looks like:

getData: function (response) {
    console.log(customerId);
    console.log(response);
    return { data: response };
}

It prints the correct customerId and also the correct response from the server but still the rows aren't populated.

Here is a link to replicate the issue.

Select a random row and click edit. The new grid populates just fine. Close the dialog and edit a different row. The new grid shows no records. Open your browser console to confirm that the new data is coming from the webservice.

Thanks.

1

There are 1 best solutions below

0
On

append an array name to your json string like this:

 var feedbackChkList = await _clientFeedBackBL.FeedbckChkList(id);
            StringBuilder sb = new StringBuilder(@"{""data"":");
            string json = JsonConvert.SerializeObject(feedbackChkList);
            sb.Append(json);
            sb.Append("}");
            return this.Content(sb.ToString());

it worked for me.