I added the ZendX library.
Added the helper in controller:
public function init()
{
$this->view->addHelperPath(
'ZendX/JQuery/View/Helper'
,'ZendX_JQuery_View_Helper');
}
Created a form for view page:
public function indexAction()
{
// Filter form
$this->view->autocompleteElement = new ZendX_JQuery_Form_Element_AutoComplete('txtLocation');
$this->view->autocompleteElement->setAttrib('placeholder', 'Search Location');
$this->view->autocompleteElement->setJQueryParam('data', array('Manila', 'Pasay', 'Mandaluyong', 'Pasig', 'Marikina','Makati'));
}
Load jQuery and form in view page.
<?php echo $this->jQuery(); ?>
<form>
<?php echo $this->autocompleteElement; ?>
</form>
The form is visible in the view page. But the autocomplete isn't working. I even don't see any jQuery script in the source page. Have I missed something?