ZendX jQuery Autocomplete not working in framework
Posted
by
Jan-Dean Fajardo
on Stack Overflow
See other posts from Stack Overflow
or by Jan-Dean Fajardo
Published on 2012-06-25T09:14:04Z
Indexed on
2012/06/25
9:15 UTC
Read the original article
Hit count: 246
- 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?
© Stack Overflow or respective owner