Hi there,

ZendX_JQuery_View_Helper_AutoComplete does not render the javascript right, so the autocomplete element does not work. The autocomplete function expects the first paramter to be the url or the data, but the helper renders them in the options object. So url or data need to be extracted from the params array and passed as first parameter, while the remaining parameters need to be passed as second parameter.

if (isset($params['url']) {
  $first = $params['url'];
  unset($params['url']);
} elseif  (isset($params['data'])) {
  $first = $params['data'];
  unset($params['data']);
} else {
  throw new Exception(...);
}
$js = sprintf('%s("#%s").autocomplete(%s, %s);',
  ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(),
  $attribs['id'],
  Zend_Json::encode($first),
  Zend_Json::encode($params)
);

This should work.

Cheers Jan

Reply via email to