I am looking to get the full url of the last request to my ajax service made by JqGridincluding page, records per page, search params etc.
Is there any method or collection of methods within the JqGrid api I can use to achieve this?
I am looking to get the full url of the last request to my ajax service made by JqGridincluding page, records per page, search params etc.
Is there any method or collection of methods within the JqGrid api I can use to achieve this?
jqGrid don't save somewhere the full URL appended with all parameters. So it is *not possibl*e within the jqGrid API archive this.
To see full URL you can use Firebug, Fiddler or other close tool.
In general it is well known how the url will constructed. How I understand indirectly you want use HTTP GET (mtype: "GET"
). I explain the construction of the URL in case of HTTP GET.
The full URL of the GET requests will constructed from:
url
parameter of the jqGridpostData
parameter of the jqGridprmNames
parameter of jqGrid (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options#how_to_overwrite_global_options). For example if you define prmNames: {sort: "searchIndex", order: "searchDirection", search: null, nd: null}
then parameters sidx
and sord
will be renamed to searchIndex
and searchDirection
. Parameters _search
and nd
will not send.Below you find some typical urls:
The first url requests loading of the first page of data, 20 rows per page, no sorting. The second url has sorting by Name
. The third url contain data filtering (with simple searching) based on the filter "Manufacture
begins with Micro
" and sorting by Name
. Results are paged by 10 rows per page and the first page are requested.
In case of using Advanced Searching or Toolbar Searching instead of Simple Searching the url will looks like a little other. Everithing are documented unter http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs. If you do have additional questions I'll can explain all more detailed.
It is important to understand that parameters used in URL should be encoded. So if you want cunstruct url yourself like
"baseUrl?firstName=" + myFirstName + '&lastName=' + myLastName
you should don't forget to use encodeURIComponent
function to encode myFirstName
and myLastName
. Instead of that you can use jQuery.param
(see http://stackoverflow.com/questions/3513175/why-my-search-code-does-not-work-on-internet-explorer/3513441#3513441) or better use postData
parameter of the jqGrid (see http://stackoverflow.com/questions/2826478/jqgrid-not-updating-data-on-reload/2827032#2827032 and http://stackoverflow.com/questions/2928371/how-to-filter-the-jqgrid-data-not-using-the-built-in-search-filter-box/2928819#2928819)e. In the last case symbols '?' and '&' will be inserted in the url if it is needed and all data values will be encoded with respect of encodeURIComponent
.