How to add single quotes around query string using jqGrid

前端 未结 1 1228
后悔当初
后悔当初 2021-01-27 10:28

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 st

1条回答
  •  醉梦人生
    2021-01-27 10:52

    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

    serializeGridData: function (postData) {
        var myPostData = $.extend({}, postData); // make a copy of the input parameter
        myPostData.sidx = "'" + myPostData.sidx + "'";
        myPostData.sord = "'" + myPostData.sord + "'";
        return myPostData;
    }
    

    0 讨论(0)
提交回复
热议问题