I got it finally working. It was the layout I think.
I modifiend the method inside my controller.
function autocomplete ()
{
$this->layout = "ajax"; // This is probably wy it was not
working.
if(empty($this->params['data']))
{
echo "DaTA EMPTY";
}else{
$this->set('productos',
$this->Producto->findAll(
"descripcion LIKE '%{$this->data['Producto']['descripcion']}%'")
);
}
The autocomplete.thtml looks like this.
<ul>
<?php foreach($productos as $producto): ?>
<li>
<?php echo $producto['Producto']['descripcion']; ?>
</li>
<?php endforeach; ?>
</ul>
And the view that uses the autocomplete.thtml called searchname.thtml
looks like this
<form action="/productos/autocomplete" method="POST">
<?php echo $ajax->autoComplete('Producto/descripcion',
'/productos/autocomplete')?>
<?php echo $html->submit('View Post')?></form>
Hope it helps someone else.
On 6/1/06, Carlos Mauricio Samour <[EMAIL PROTECTED]> wrote:
> I even hardcoded de list in my autocomplete.thtml to see if is my controller.
>
> <ul>
> <li>
> PANTALON CASUAL DE VESTIR </li>
> <li>
> PANTALON JEANS ADOBE </li>
> <li>
> CAMISA DE BEBE PAYASITO </li>
>
> <li>
> CAMISA DE BEBE PAYASITO rayado </li>
> </ul>
>
> And still retuns nothign.
> On 6/1/06, Carlos Mauricio Samour <[EMAIL PROTECTED]> wrote:
> > I know it susck! :(
> >
> > On 6/1/06, Jf <[EMAIL PROTECTED]> wrote:
> > >
> > > I have the same problem,
> > >
> > > nothing appear, no javascript error
> > > the pr($this->data); return too nothing
> > >
> > >
> > > > > >
> > >
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---