douwendu2460 2013-01-03 11:48
浏览 11
已采纳

如何在zend分页中添加额外的参数

enter image description hereHow i can add extra parameter in the zend paging.I have to provide filter functionality in the listing user. so i want to send search keywords with page numbers.

Paging code

$page = $this->_getParam('page', 1);
        $paginator = Zend_Paginator::factory($data);
        $paginator->setItemCountPerPage(2);//PAGING_RESULT_PER_PAGE
        $paginator->setCurrentPageNumber($page);
        $paginator->setPageRange(PAGING_PAGES_RANGE_PER_PAGE);
        $this->view->users = $paginator;

I want to add search data onchange event to the paging . This paging is working using ajax now what i want to it should be changed as per the filter data. I am not able to perform this....can you please provlde me any suggestion please

  • 写回答

2条回答 默认 最新

  • dream198731 2013-01-04 07:13
    关注

    You can change the code from the javascript.

    <script>
    $(document).ready(function(){
        $('.paginationControl a').click(function(){
            if($('#keyword').val() != '')
            {
                var href = $(this).attr('href')+'/keyword/'+$('#keyword').val();
                $(this).attr('href', href);
            }
        });
    });
    </script>
    
    <input type="text" name="keyword" value="" id="keyword"/>
    
    
    <div class="paginationControl">
      <a href="/page/2">2</a> 
      <a href="/page/3">3</a>
      <a href="/page/4">4</a>
      <a href="/page/5">5</a>
    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?