我需要一个使用jquery的自动补全功能,我遇到过ZendX_JQuery,它就有这样的功能。
但是,我注意到整个ZendX_JQuery类都有点旧(默认的jquery版本是1.3.2,jquery ui是1.7.1)。(参见http://framework.zend.com/svn/framework/extras/branches/release-1.10/library/ZendX/JQuery.php)
我应该使用它而不是我自己编写的代码来包含jquery库等,我应该使用ZendX_JQuery_View_Helper_AutoComplete类来实现这些功能吗?
发布于 2010-06-06 21:20:58
ZendX仍处于活动状态。我使用jQueryUI实现自动补全。下面是一些用法示例。
jQuery配置。
$view->jQuery()->setLocalPath('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js')
->enable()
->setUiLocalPath('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js')
->uiEnable()
->addStylesheet('/ui/css/blitzer/jquery-ui-1.8.custom.css')查看文件。
echo $this->autoComplete($id, $value, $params, $attribs);http://jqueryui.com/demos/autocomplete/
http://framework.zend.com/manual/en/zendx.jquery.view.html
发布于 2010-06-06 23:15:57
$view->jQuery()
->setVersion('1.4.2')
->enable()
->setUiVersion('1.8.1')
->uiEnable()
->addStylesheet('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/ui-lightness/jquery-ui.css');表单元素:
$el = $this->createElement('autoComplete', 'movie_id',
array(
'cols' => 30,
'label' => 'Movie ID или Название фильма. Набрать 3 символа и подождать.',
'required' => true,
'autocomplete' => 'off',
'filters' => array('StringTrim'),
'validators' => array(
'Int',
array('Db_RecordExists', false, array(
'model' => 'Movies_Model_Movie',
'field' => 'id'
))
),
'jQueryParams' => array(
'source' => $this->getView()->movieLinker()->crudListAutocompleteMovieId(),
'minLength' => 3,
)
)
);https://stackoverflow.com/questions/2983786
复制相似问题