编程语言
首页 > 编程语言> > PHP-Zendx jQuery自动完成

PHP-Zendx jQuery自动完成

作者:互联网

当我在Zend documentation中注意到此部分时,我一直在尝试使Zend Jquery自动完成功能起作用.

The following UI widgets are available as form view helpers. Make sure you use the correct version of jQuery UI library to be able to use them. The Google CDN only offers jQuery UI up to version 1.5.2. Some other components are only available from jQuery UI SVN, since they have been removed from the announced 1.6 release.

autoComplete($id, $value, $params, $attribs): The AutoComplete View helper will be included in a future jQuery UI version (currently only via jQuery SVN) and creates a text field and registeres it to have auto complete functionality. The completion data source has to be given as jQuery related parameters ‘url’ or ‘data’ as described in the jQuery UI manual.

有谁知道我需要下载哪个svn url标记或分支才能获得具有自动完成功能的javascript文件?

目前,我的Bootstrap.php已

    $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); 
    $view->jQuery()->enable();
    $view->jQuery()->uiEnable();
    Zend_Controller_Action_HelperBroker::addHelper(
        new ZendX_JQuery_Controller_Action_Helper_AutoComplete()
    );

    // Add it to the ViewRenderer
    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
    $viewRenderer->setView($view);
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

在我的布局中,我定义了我想要的jQuery UI版本

<?php echo $this->jQuery()
    ->setUiVersion('1.7.2');?>

最后,我的index.phtml具有自动完成小部件

<p><?php $data = array('New York', 'Tokyo', 'Berlin', 'London', 'Sydney', 'Bern', 'Boston', 'Baltimore'); ?>
<?php echo $this->autocomplete("ac1", "", array('data' => $data));?></p>

我正在使用Zend 1.8.3 atm.

解决方法:

我上次检查时是在dev branch.

唯一的问题是,我不确定这是否完成和准备就绪,甚至不能与ZendX_Jquery一起使用.您可以在the progress of autoComplete on the official wiki page上保持最新.

标签:jquery-ui,zend-framework,php,jquery
来源: https://codeday.me/bug/20191210/2102626.html