I am trying to migrate my autocomplete to JSHelper using JQuery (As the
default). And I think there are no documentation or examples yet that has
been publicized as of this writing.

Anyway, I did what the manual has told...

*Controller:*
var $helpers = array('Html', 'Form', 'Time', 'Js' => array('Jquery'));

*Default.ctp*
echo $html->script('
http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js');
$this->Js->JqueryEngine->jQueryObject = '$j';
print $this->Html->scriptBlock('var $j = jQuery.noConflict();',
    array('inline' => false)); //Tell jQuery to go into noconflict mode

*Now, from autocomplete (under view).*

*The old code:*
<?php echo $ajax->autoComplete('q', '/publications/autocompletetitle',
array('minChars' => 4, 'class' => 'search')); ?>

*Was switched to the following:*
<?php echo $js->autoComplete('q', '/publications/autocompletetitle',
array('minChars' => 4, 'class' => 'search')); ?>

And the usual, it did not worked! :(. I turned-on debug and found this error
message.
*JsHelper:: Missing Method autoComplete is undefined
[CORE/cake/libs/view/helpers/js.php, line 154]*

So, I searched the API for JSHelper.
http://api13.cakephp.org/view_source/js-helper/

And I did not find the code. The odd thing was actually following the
example of the cakephp book for 1.3 for autocomplete.
http://book.cakephp.org/view/1370/autoComplete, and it turned out wrong.

Any ideas, how can I make autocomplete work on the new JSHelper? But, if the
method does not exist, then it won't make any sense. I think I am missing
something here? :(

Please help.
--
Louie Miranda
 - Email: lmira...@gmail.com
 - Web: http://www.louiemiranda.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to