0

我有一个索引作为我的 jqGrid 的额外搜索选项:

<a class="letter" href="javascript:void">C</a>


 $(".letter").click(
        function (e) {
            e.preventDefault();
            var letter = this.innerHTML;
            $.ajax({
                url: '@Url.Action("Products")',
                type:'POST',
                data: '_search=true&nd=1345531875941&rows=5&page=1&sidx=ProductID&sord=asc&filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22ProductName%22%2C%22op%22%3A%22bw%22%2C%22data%22%3A%22'+letter+ '%22%7D%5D%7D&searchField=&searchString=&searchOper=',
                success: function(data){
                    jQuery("#jqgProducts")[0].addJSONData(data);
            }
            });
        });

检索到的数据很好(以“C”开头的行),寻呼机显示:“第 1 页,共 2 页”。但是,当我想转到第二页时,它不会显示正确的数据(这将是其他以“C”开头的名称)。如何使页面显示正确的数据?

4

1 回答 1

0
data: '_search=true&nd=1345531875941&rows=5&page=1&sidx=ProductID&sord=asc&filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22ProductName%22%2C%22op%22%3A%22bw%22%2C%22data%22%3A%22'+letter+ '%22%7D%5D%7D&searchField=&searchString=&searchOper='

动态传递参数 test "page=1" 到 "page=2" 或手动进行测试

手动:

data: '_search=true&nd=1345531875941&rows=5&page=2&sidx=ProductID&sord=asc&filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22ProductName%22%2C%22op%22%3A%22bw%22%2C%22data%22%3A%22'+letter+ '%22%7D%5D%7D&searchField=&searchString=&searchOper='

动态:

data: '_search=true&nd=1345531875941&rows=5&page='+anyPage+'&sidx=ProductID&sord=asc&filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22ProductName%22%2C%22op%22%3A%22bw%22%2C%22data%22%3A%22'+letter+ '%22%7D%5D%7D&searchField=&searchString=&searchOper='
于 2012-08-22T02:37:09.623 回答