views:

34

answers:

1

I'm using jqGrid with a restful api. By default when I click "next page", I get a url like:

http://myservice.com?rows=20&page=2

(I'm leaving out some params to keep the example simple.)

The service expects a url like:

http://myservice.com?limit=20&offset=2

What's the easiest way to set up that translation?

A: 

You want to set the prmNames option. See the options documentation.

Craig Stuntz
That's terrific, thanks. Related question: the service has an offset parameter (i.e. the number of records to skip), while this has a page param. Is there a way for me to make /that/ translation?
sprugman
You might be able to do it in `beforeRequest`: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events
Craig Stuntz
yeah, I was thinking it would be something like that. I'll try it, thanks!
sprugman