如何使用 jqGrid 在查询字符串周围添加单引号
我正在使用 jqGrid
向用户显示一些数据。我希望这个网格可以排序,但是 jqGrid 发送的数据并不完全是我需要的。
这是 jqGrid 现在发送的查询字符串:
http://local/MyService.svc/GetData?_search=false&nd=1313069918597&rows=50&page=1&sidx=ColumnName&sord=asc
但我的服务需要它是:
http://local/MyService.svc/GetData?_search=false&nd=1313069918597&rows=50&page=1&sidx='ColumnName'&sord='asc'
注意 ColumnName
和 asc
周围的单引号
有大量的 jqGrid 选项,但我没有找到了任何允许我以这种方式操作查询字符串参数的东西。非常感谢任何帮助!
I'm using jqGrid
to display some data to users. I want this grid to be sortable, but the data jqGrid sends isn't exactly what I need.
Here is the query string jqGrid sends now:
http://local/MyService.svc/GetData?_search=false&nd=1313069918597&rows=50&page=1&sidx=ColumnName&sord=asc
But my service needs it to be:
http://local/MyService.svc/GetData?_search=false&nd=1313069918597&rows=50&page=1&sidx='ColumnName'&sord='asc'
Notice the single quotes around ColumnName
and asc
There are tons of jqGrid options and I haven't found anything that allows me to manipulate the querystring parameters in this way. Any help is much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jqGrid 有 serializeGridData 事件/参数可以帮助您解决服务器请求定制的任何问题。在您的情况下, serializeGridData 可能如下所示
There are serializeGridData event/parameter of jqGrid which can help you solve any problems of customization of the server requests. In your case the serializeGridData could looks as following