0

我在 users.filer 列表中按字母顺序添加了过滤器功能。我已经在控制器中发送了 ajax 请求,但它没有向我发送过滤后的数据。

这是我的代码

if($this->_request->isXmlHttpRequest()) {
            //$this->_helper->viewRenderer->setNoRender();
            $this->_helper->getHelper('layout')->disableLayout();
            //die('sdfdsf');
            if(isset($params['txt_username']) && !empty($params['txt_username'])) {
                $select->where(PREFIX_USERS . 'username like "%' . $params['txt_username'] . '%"');
                $this->view->test_array = $this->getRequest()->getParams();

                //$this->_helper->P($ajax_parameters);
                //echo $_SESSION['user_list_ajax_search'];
                //$this->view->pageParams = $_SESSION['user_list_ajax_search'];
                //$select->where(PREFIX_USERS . 'username like "%' . $_SESSION['user_list_ajax_search'] . '%"');

            }
        }


        //echo $select->__toString();
        $data = $obj_user->fetchAll($select);

        # Paging section
        $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;
4

1 回答 1

0

这些 :

$params['txt_username']

应该是:

$this->getRequest()->getParam('txt_username')

或使用:

$params = $this->getRequest()->getParams();

除非它在那里并且您没有发布那段代码。

于 2013-01-03T15:22:50.343 回答