我在我的网络应用程序中使用主干分页器插件(服务器模式)。该插件以页面的形式与服务器对话。例如,要获取第 5 页的结果,它会发出如下请求(取自分页器服务器示例:http ://backbone-paginator.github.io/backbone.paginator/examples/server-mode.html )
https://api.github.com/search/issues?page=5&per_page=15&...
但是我的服务器接受计数和偏移值而不是 page 和 per_page。所以,我必须转换
"page=5" to "offset=76" (assuming page size is 15).
相似地
"per_page=15" becomes "count=15".
所以,修改后的请求应该是这样的,
https://api.github.com/search/issues?offset=101&count=15&...
我可以使用“queryParams”哈希更改参数的名称。但无法弄清楚如何将 page=5 更改为 offset=76。
我想我应该重写 get*page 方法,但是我无法访问查询参数。
对此的任何帮助都将受到高度赞赏。