gpt4 book ai didi

php - Zendx JQuery 自动完成

转载 作者:搜寻专家 更新时间:2023-10-31 20:56:29 25 4
gpt4 key购买 nike

当我注意到 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 了解最新信息.

关于php - Zendx JQuery 自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1128490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com