Edit to answer:
I have tried the following
$(document).ajaxSuccess (function(ev, xhr, s) {
document.write('url: ' + s.data);
});
And I just get a blank page – it does write out the right data though, just not the rest of the page
Hi, I am using flexigrid, and im posting parameters to from flexigrid.js to a php script to return json to the grid.
Flexigrid allows me to sort, filter etc. just as jquery should allow.
I want to catch the last posted parameters to flexigrid so that I can build a csv to allow download of the same (full) information.
However, flexigrid wont allow me to access the posted parameters.
Is this because flexigrid script keeps all those parameters in its own scope? I notice a variable/object called sitems inside firebug that basically has all the info I need, but javascript wont let me access it. Is there any way to access parameters sent to flexigrid? any help is much appreciated.
Cheers Ke
Well I’m not familiar with flexigrid but taking a quick peak at the source used on their homepage, it uses jQuery’s
$.ajaxto make the requests to your PHP backend. So although the flexigrid API may not allow you to discover the parameters that it is posting, you can use the hooks that jQuery provides (the global ajax events) to monitor what is going on. In particular, ajaxSuccess will give you the info you want once the flexigrid request to your backend has returned successfully, at which point you can use the data that was posted to build your CSV link.Try pasting this into the firebug console while on the flexigrid homepage, running it and then clicking a column header in the Example 3 (Flexigrid with a dynamic data):
You should see the
datavalue that was used in the$.ajaxrequest made by the flexegrid in your console output. e.g.