Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Access payload submitted with a remotedatasource call
posted

Hello there,

is there a way to access additional payload that is send within a JSONresponse to an igGrid?

e.g.

Currently the igGrid gets filled with a JSON object looking like this:

{Records: DATA, TotalRecordsCount: 0}

Now I want to send something like this:

{Records: DATA, TotalRecordsCount: 0, Sums: DATA2}

And then in igGrids OnDataBound I want to access "Sums" and fill it into the Headers for my columns in the igGrid.

I am calculating the sum of some columns on the server because the client uses paging and is not aware of the whole data content to work with. Also i know i could store it on the server in a 2min cache or whatever and make a 2nd ajax call in the OnDataBound to retrieve the sums for my columns but i would rather not do a 2nd request to the server just for some minor data.

While in the DataBound event i can see the "_ajaxRequest.responseText" inside the a.dataSource object (function gridDataBound(e, a))... but I don't think that would be the right way to access the data and I cannot find a method to get the full response only the mapped ones from "Records".

Long story short, how to access the full JSON response that is requested by the igGrid on filter/sort updating.

Parents Reply Children
No Data