Re: JQuery autocomplete on Cakephp 3.0
hola, Solucionado, para que jquery autocomplete, los campos devueltos deben llamarse "value" y "label" El dilluns, 12 octubre de 2015 22:48:52 UTC+2, Christian Quispe va escriure: > > Revisa si tienes los css incluidos. > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/121ae77715bc0eb6a3abf916d50c78dd2bca2a9a?url=http%3A%2F%2Foxicode.io&signature=93aefc105306cc5e>* > > *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores > constantemente...* > > > El 12 de octubre de 2015, 3:32 p. m., Raul Magdalena Catala< > raulma...@gmail.com > escribió: > >> hola de nuevo Christian, >> >> finalmente he consegido una respuesta json de un controlador pero el >> input intenta autocompletar pero se queda a medio camino. Pego la pantalla >> que es más facil verlo que explicarlo >> >> >> <https://lh3.googleusercontent.com/-QD76wOgPOCk/VhwYcZXiFuI/eKQ/CtlJc5f_XpM/s1600/Captura%2Bde%2B2015-10-12%2B22%253A27%253A28.png> >> >> ¿sabes a que se debe este comportamiento del input? >> He comprobado que la respuesta json esta bien formateada. >> >> gracias >> >> El divendres, 9 octubre de 2015 9:27:16 UTC+2, Raul Magdalena Catala va >> escriure: >>> >>> hola >>> >>> el código del controladores muy sencillo >>> >>> >> class CarsController extends AppController { >>> >>> public $layout = 'basic'; >>> >>> public $components = array <http://www.php.net/array>( >>> 'RequestHandler'); >>> >>> public function index() { >>> if ($this->request->is('ajax')) { >>> $term = $this->request->query('term'); >>> $carNames = $this->Car->getCarNames($term); >>> $this->set(compact <http://www.php.net/compact>('carNames')); >>> $this->set('_serialize', 'carNames'); >>> } >>> } >>> } >>> >>> >>> >>> El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va >>> escriure: >>> >>> Ahiy esta el error. Hay un problema con la función. >>> >>> Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el >>> código del controlador para ver en que has metido la pata >>> >>> Enviado desde Gmail para Moto G >>> >>> www.oxicode.io >>> El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" >>> escribió: >>> >>> Hola Christian, >>> >>> tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. >>> >>> la ruta en el script es correcta: >>> >>> $(document).ready(function(){ >>> $('#autocomplete').autocomplete({ >>> source: "/cars/index.json", >>> }); >>> }); >>> >>> finalmente te paso la pertaña network >>> >>> >>> <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> >>> >>> >>> >>> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >>> >>> Ya veo, el problema viene por la vista, tienes el archivo creado en la >>> vista?, si usas solo controlador debes tener >>> >>> $this->set('_serialize', ['articles']); >>> >>> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >>> hacer conflicto >>> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >>> request, subpestaña preview >>> >>> >>> >>> Enviado con MailTrack >>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>> >>> Saludos >>> >>> Christian Quispe >>> >>> *Geek and Developer* >>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>> >>> *Portafolio: www.oxicode.io >>> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >>> >>> ... >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to cake-php+u...@googlegroups.com . >> To post to this group, send email to cake...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/cake-php. >> For more options, visit https://groups.google.com/d/optout. >> > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: JQuery autocomplete on Cakephp 3.0
Revisa si tienes los css incluidos. Enviado con MailTrack <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> Saludos Christian Quispe *Geek and Developer* *Miembro: * *GDG Lima (Google Developer Group Lima)* *Portafolio: www.oxicode.io <https://mailtrack.io/trace/link/121ae77715bc0eb6a3abf916d50c78dd2bca2a9a?url=http%3A%2F%2Foxicode.io&signature=93aefc105306cc5e>* *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...* El 12 de octubre de 2015, 3:32 p. m., Raul Magdalena Catala< raulmagdal...@gmail.com> escribió: > hola de nuevo Christian, > > finalmente he consegido una respuesta json de un controlador pero el input > intenta autocompletar pero se queda a medio camino. Pego la pantalla que es > más facil verlo que explicarlo > > > <https://lh3.googleusercontent.com/-QD76wOgPOCk/VhwYcZXiFuI/eKQ/CtlJc5f_XpM/s1600/Captura%2Bde%2B2015-10-12%2B22%253A27%253A28.png> > > ¿sabes a que se debe este comportamiento del input? > He comprobado que la respuesta json esta bien formateada. > > gracias > > El divendres, 9 octubre de 2015 9:27:16 UTC+2, Raul Magdalena Catala va > escriure: >> >> hola >> >> el código del controladores muy sencillo >> >> > class CarsController extends AppController { >> >> public $layout = 'basic'; >> >> public $components = array <http://www.php.net/array>( >> 'RequestHandler'); >> >> public function index() { >> if ($this->request->is('ajax')) { >> $term = $this->request->query('term'); >> $carNames = $this->Car->getCarNames($term); >> $this->set(compact <http://www.php.net/compact>('carNames')); >> $this->set('_serialize', 'carNames'); >> } >> } >> } >> >> >> >> El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va >> escriure: >> >> Ahiy esta el error. Hay un problema con la función. >> >> Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el >> código del controlador para ver en que has metido la pata >> >> Enviado desde Gmail para Moto G >> >> www.oxicode.io >> El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" >> escribió: >> >> Hola Christian, >> >> tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. >> >> la ruta en el script es correcta: >> >> $(document).ready(function(){ >> $('#autocomplete').autocomplete({ >> source: "/cars/index.json", >> }); >> }); >> >> finalmente te paso la pertaña network >> >> >> <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> >> >> >> >> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >> >> Ya veo, el problema viene por la vista, tienes el archivo creado en la >> vista?, si usas solo controlador debes tener >> >> $this->set('_serialize', ['articles']); >> >> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >> hacer conflicto >> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >> request, subpestaña preview >> >> >> >> Enviado con MailTrack >> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >> >> Saludos >> >> Christian Quispe >> >> *Geek and Developer* >> *Miembro: * *GDG Lima (Google Developer Group Lima)* >> >> *Portafolio: www.oxicode.io >> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >> >> ... > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: JQuery autocomplete on Cakephp 3.0
hola de nuevo Christian, finalmente he consegido una respuesta json de un controlador pero el input intenta autocompletar pero se queda a medio camino. Pego la pantalla que es más facil verlo que explicarlo <https://lh3.googleusercontent.com/-QD76wOgPOCk/VhwYcZXiFuI/eKQ/CtlJc5f_XpM/s1600/Captura%2Bde%2B2015-10-12%2B22%253A27%253A28.png> ¿sabes a que se debe este comportamiento del input? He comprobado que la respuesta json esta bien formateada. gracias El divendres, 9 octubre de 2015 9:27:16 UTC+2, Raul Magdalena Catala va escriure: > > hola > > el código del controladores muy sencillo > >class CarsController extends AppController { > > public $layout = 'basic'; > > public $components = array <http://www.php.net/array>('RequestHandler' > ); > > public function index() { > if ($this->request->is('ajax')) { > $term = $this->request->query('term'); > $carNames = $this->Car->getCarNames($term); > $this->set(compact <http://www.php.net/compact>('carNames')); > $this->set('_serialize', 'carNames'); > } > } > } > > > > El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va > escriure: > > Ahiy esta el error. Hay un problema con la función. > > Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el > código del controlador para ver en que has metido la pata > > Enviado desde Gmail para Moto G > > www.oxicode.io > El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" > escribió: > > Hola Christian, > > tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. > > la ruta en el script es correcta: > > $(document).ready(function(){ > $('#autocomplete').autocomplete({ > source: "/cars/index.json", > }); > }); > > finalmente te paso la pertaña network > > > <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> > > > > El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: > > Ya veo, el problema viene por la vista, tienes el archivo creado en la > vista?, si usas solo controlador debes tener > > $this->set('_serialize', ['articles']); > > tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede > hacer conflicto > pasame un pantallazo de la pestaña Network, el ultimo item debe ser el > request, subpestaña preview > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* > > ... -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: JQuery autocomplete on Cakephp 3.0
El mensaje dice que no se conoce el método. ¬¬ Enviado con MailTrack <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> Saludos Christian Quispe *Geek and Developer* *Miembro: * *GDG Lima (Google Developer Group Lima)* *Portafolio: www.oxicode.io <https://mailtrack.io/trace/link/35b7e970199b9751a04177810cd643be9a54ebf9?url=http%3A%2F%2Foxicode.io&signature=809819a88222f6a5>* *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...* El 12 de octubre de 2015, 2:06 p. m., Raul Magdalena Catala< raulmagdal...@gmail.com> escribió: > Hola Christian, > > si ejecuto: > > $carNames=$this->getCarNames($term); > > el mensaje de error es: > > "message": "Call to undefined method > App\\Controller\\CarsController::getCarNames()" > > creo que por aquí no es > > > El dilluns, 12 octubre de 2015 19:14:11 UTC+2, Christian Quispe va > escriure: >> >> Aqui está el error >> >> $carNames = $this->Car->getCarNames($term); >> >> >> >> >> Enviado con MailTrack >> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >> >> Saludos >> >> Christian Quispe >> >> *Geek and Developer* >> *Miembro: * *GDG Lima (Google Developer Group Lima)* >> >> *Portafolio: www.oxicode.io >> <https://mailtrack.io/trace/link/75dc42b78179b3e7023f1b6e4830b2da0212176b?url=http%3A%2F%2Foxicode.io&signature=379246377cd7d4fe>* >> >> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >> constantemente...* >> >> >> El 9 de octubre de 2015, 2:27 a. m., Raul Magdalena Catala< >> raulma...@gmail.com> escribió: >> >> hola >> >> el código del controladores muy sencillo >> >> > class CarsController extends AppController { >> >> public $layout = 'basic'; >> >> public $components = array <http://www.php.net/array>( >> 'RequestHandler'); >> >> public function index() { >> if ($this->request->is('ajax')) { >> $term = $this->request->query('term'); >> $carNames = $this->Car->getCarNames($term); >> $this->set(compact <http://www.php.net/compact>('carNames')); >> $this->set('_serialize', 'carNames'); >> } >> } >> } >> >> >> >> El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va >> escriure: >> >> Ahiy esta el error. Hay un problema con la función. >> >> Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el >> código del controlador para ver en que has metido la pata >> >> Enviado desde Gmail para Moto G >> >> www.oxicode.io >> El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" >> escribió: >> >> Hola Christian, >> >> tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. >> >> la ruta en el script es correcta: >> >> $(document).ready(function(){ >> $('#autocomplete').autocomplete({ >> source: "/cars/index.json", >> }); >> }); >> >> finalmente te paso la pertaña network >> >> >> <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> >> >> >> >> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >> >> Ya veo, el problema viene por la vista, tienes el archivo creado en la >> vista?, si usas solo controlador debes tener >> >> $this->set('_serialize', ['articles']); >> >> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >> hacer conflicto >> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >> request, subpestaña preview >> >> >> >> Enviado con MailTrack >> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >> >> Saludos >> >> Christian Quispe >> >> *Geek and Developer* >> *Miembro: * *GDG Lima (Google Developer Group Lima)* >> >> *Portafolio: www.oxicode.io >> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >> >> *¿A
Re: JQuery autocomplete on Cakephp 3.0
Hola Christian, si ejecuto: $carNames=$this->getCarNames($term); el mensaje de error es: "message": "Call to undefined method App\\Controller\\CarsController::getCarNames()" creo que por aquí no es El dilluns, 12 octubre de 2015 19:14:11 UTC+2, Christian Quispe va escriure: > > Aqui está el error > > $carNames = $this->Car->getCarNames($term); > > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/75dc42b78179b3e7023f1b6e4830b2da0212176b?url=http%3A%2F%2Foxicode.io&signature=379246377cd7d4fe>* > > *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores > constantemente...* > > > El 9 de octubre de 2015, 2:27 a. m., Raul Magdalena Catala< > raulma...@gmail.com > escribió: > > hola > > el código del controladores muy sencillo > >class CarsController extends AppController { > > public $layout = 'basic'; > > public $components = array <http://www.php.net/array>('RequestHandler' > ); > > public function index() { > if ($this->request->is('ajax')) { > $term = $this->request->query('term'); > $carNames = $this->Car->getCarNames($term); > $this->set(compact <http://www.php.net/compact>('carNames')); > $this->set('_serialize', 'carNames'); > } > } > } > > > > El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va > escriure: > > Ahiy esta el error. Hay un problema con la función. > > Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el > código del controlador para ver en que has metido la pata > > Enviado desde Gmail para Moto G > > www.oxicode.io > El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" > escribió: > > Hola Christian, > > tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. > > la ruta en el script es correcta: > > $(document).ready(function(){ > $('#autocomplete').autocomplete({ > source: "/cars/index.json", > }); > }); > > finalmente te paso la pertaña network > > > <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> > > > > El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: > > Ya veo, el problema viene por la vista, tienes el archivo creado en la > vista?, si usas solo controlador debes tener > > $this->set('_serialize', ['articles']); > > tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede > hacer conflicto > pasame un pantallazo de la pestaña Network, el ultimo item debe ser el > request, subpestaña preview > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* > > *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores > constantemente...* > > > 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala : > > Gracias Christian, > > ya he consegido, creo, que se realice la llamada cuando escribo algo en el > input > > > <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> > > > pero siguen sin autocompletarse. > Ahora cuando escribo la misma url ( > http://localhost:8765/cars/index.json?term=fo) directamente en el > navegador, me responde: > > { > "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is missing.", > "url": "\/cars\/index.json?term=fo", > "code": 500 > } > > > > saludos > > El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va > escriure: > > Hola Raul > Nos compares los debugs? o algún pantallazo de la consola de chromeDev > cuando intentas ejecutarlo > > > > Enviado con MailTrack > <https://mailtrack.io/install?so
Re: JQuery autocomplete on Cakephp 3.0
Aqui está el error $carNames = $this->Car->getCarNames($term); Enviado con MailTrack <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> Saludos Christian Quispe *Geek and Developer* *Miembro: * *GDG Lima (Google Developer Group Lima)* *Portafolio: www.oxicode.io <https://mailtrack.io/trace/link/75dc42b78179b3e7023f1b6e4830b2da0212176b?url=http%3A%2F%2Foxicode.io&signature=379246377cd7d4fe>* *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...* El 9 de octubre de 2015, 2:27 a. m., Raul Magdalena Catala< raulmagdal...@gmail.com> escribió: > hola > > el código del controladores muy sencillo > >class CarsController extends AppController { > > public $layout = 'basic'; > > public $components = array <http://www.php.net/array>('RequestHandler' > ); > > public function index() { > if ($this->request->is('ajax')) { > $term = $this->request->query('term'); > $carNames = $this->Car->getCarNames($term); > $this->set(compact <http://www.php.net/compact>('carNames')); > $this->set('_serialize', 'carNames'); > } > } > } > > > > El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va > escriure: >> >> Ahiy esta el error. Hay un problema con la función. >> >> Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el >> código del controlador para ver en que has metido la pata >> >> Enviado desde Gmail para Moto G >> >> www.oxicode.io >> El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" >> escribió: >> >>> Hola Christian, >>> >>> tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. >>> >>> la ruta en el script es correcta: >>> >>> $(document).ready(function(){ >>> $('#autocomplete').autocomplete({ >>> source: "/cars/index.json", >>> }); >>> }); >>> >>> finalmente te paso la pertaña network >>> >>> >>> <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> >>> >>> >>> >>> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >>>> >>>> Ya veo, el problema viene por la vista, tienes el archivo creado en la >>>> vista?, si usas solo controlador debes tener >>>> >>>> $this->set('_serialize', ['articles']); >>>> >>>> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >>>> hacer conflicto >>>> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >>>> request, subpestaña preview >>>> >>>> >>>> >>>> Enviado con MailTrack >>>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>>> >>>> Saludos >>>> >>>> Christian Quispe >>>> >>>> *Geek and Developer* >>>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>>> >>>> *Portafolio: www.oxicode.io >>>> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >>>> >>>> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >>>> constantemente...* >>>> >>>> >>>> 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala : >>>> >>>>> Gracias Christian, >>>>> >>>>> ya he consegido, creo, que se realice la llamada cuando escribo algo >>>>> en el input >>>>> >>>>> >>>>> <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> >>>>> >>>>> >>>>> pero siguen sin autocompletarse. >>>>> Ahora cuando escribo la misma url ( >>>>> http://localhost:8765/cars/index.json?term=fo) directamente en el >>>>> navegador, me responde: >>>>> >>>>> { >>>>> "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is >>>>> missing.", >>>>>
Re: JQuery autocomplete on Cakephp 3.0
hola el código del controladores muy sencillo http://www.php.net/array>('RequestHandler'); public function index() { if ($this->request->is('ajax')) { $term = $this->request->query('term'); $carNames = $this->Car->getCarNames($term); $this->set(compact <http://www.php.net/compact>('carNames')); $this->set('_serialize', 'carNames'); } } } El divendres, 9 octubre de 2015 7:06:21 UTC+2, Christian Quispe va escriure: > > Ahiy esta el error. Hay un problema con la función. > > Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el > código del controlador para ver en que has metido la pata > > Enviado desde Gmail para Moto G > > www.oxicode.io > El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" > escribió: > >> Hola Christian, >> >> tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. >> >> la ruta en el script es correcta: >> >> $(document).ready(function(){ >> $('#autocomplete').autocomplete({ >> source: "/cars/index.json", >> }); >> }); >> >> finalmente te paso la pertaña network >> >> >> <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> >> >> >> >> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >>> >>> Ya veo, el problema viene por la vista, tienes el archivo creado en la >>> vista?, si usas solo controlador debes tener >>> >>> $this->set('_serialize', ['articles']); >>> >>> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >>> hacer conflicto >>> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >>> request, subpestaña preview >>> >>> >>> >>> Enviado con MailTrack >>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>> >>> Saludos >>> >>> Christian Quispe >>> >>> *Geek and Developer* >>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>> >>> *Portafolio: www.oxicode.io >>> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >>> >>> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >>> constantemente...* >>> >>> >>> 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala : >>> >>>> Gracias Christian, >>>> >>>> ya he consegido, creo, que se realice la llamada cuando escribo algo en >>>> el input >>>> >>>> >>>> <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> >>>> >>>> >>>> pero siguen sin autocompletarse. >>>> Ahora cuando escribo la misma url ( >>>> http://localhost:8765/cars/index.json?term=fo) directamente en el >>>> navegador, me responde: >>>> >>>> { >>>> "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is >>>> missing.", >>>> "url": "\/cars\/index.json?term=fo", >>>> "code": 500 >>>> } >>>> >>>> >>>> >>>> saludos >>>> >>>> El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va >>>> escriure: >>>>> >>>>> Hola Raul >>>>> Nos compares los debugs? o algún pantallazo de la consola de chromeDev >>>>> cuando intentas ejecutarlo >>>>> >>>>> >>>>> >>>>> Enviado con MailTrack >>>>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>>>> >>>>> Saludos >>>>> >>>>> Christian Quispe >>>>> >>>>> *Geek and Developer* >>>>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>>>> >>>>> *Portafolio: www.oxicode.io >>>>> <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63&
Re: JQuery autocomplete on Cakephp 3.0
Ahiy esta el error. Hay un problema con la función. Este tema del jquey, ajax y json es bien fácil. Fresh. Compartenos el código del controlador para ver en que has metido la pata Enviado desde Gmail para Moto G www.oxicode.io El oct. 8, 2015 2:08 AM, "Raul Magdalena Catala" escribió: > Hola Christian, > > tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. > > la ruta en el script es correcta: > > $(document).ready(function(){ > $('#autocomplete').autocomplete({ > source: "/cars/index.json", > }); > }); > > finalmente te paso la pertaña network > > > <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> > > > > El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: >> >> Ya veo, el problema viene por la vista, tienes el archivo creado en la >> vista?, si usas solo controlador debes tener >> >> $this->set('_serialize', ['articles']); >> >> tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede >> hacer conflicto >> pasame un pantallazo de la pestaña Network, el ultimo item debe ser el >> request, subpestaña preview >> >> >> >> Enviado con MailTrack >> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >> >> Saludos >> >> Christian Quispe >> >> *Geek and Developer* >> *Miembro: * *GDG Lima (Google Developer Group Lima)* >> >> *Portafolio: www.oxicode.io >> <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* >> >> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >> constantemente...* >> >> >> 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala : >> >>> Gracias Christian, >>> >>> ya he consegido, creo, que se realice la llamada cuando escribo algo en >>> el input >>> >>> >>> <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> >>> >>> >>> pero siguen sin autocompletarse. >>> Ahora cuando escribo la misma url ( >>> http://localhost:8765/cars/index.json?term=fo) directamente en el >>> navegador, me responde: >>> >>> { >>> "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is >>> missing.", >>> "url": "\/cars\/index.json?term=fo", >>> "code": 500 >>> } >>> >>> >>> >>> saludos >>> >>> El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va >>> escriure: >>>> >>>> Hola Raul >>>> Nos compares los debugs? o algún pantallazo de la consola de chromeDev >>>> cuando intentas ejecutarlo >>>> >>>> >>>> >>>> Enviado con MailTrack >>>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>>> >>>> Saludos >>>> >>>> Christian Quispe >>>> >>>> *Geek and Developer* >>>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>>> >>>> *Portafolio: www.oxicode.io >>>> <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63>* >>>> >>>> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >>>> constantemente...* >>>> >>>> >>>> 2015-10-07 16:42 GMT-05:00 Raul Magdalena Catala : >>>> >>>>> Hello, >>>>> i'm trying to use the following example of JQuery autocomplete with >>>>> Cakephp >>>>> >>>>> >>>>> http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ >>>>> >>>>> The important change between versions (if i'm not wrong) is how to >>>>> enable the parsing of extensions >>>>> >>>>> in both cases it is done in the ruotes.php file >>>>> in 2.3 by Router::parseExtensions() >>>>> in 3.0 by Router::extensions('json') >>>>> >>>>> anyway, when i write into the input, nothing happens >&g
Re: JQuery autocomplete on Cakephp 3.0
Hola Christian, tengo un archivo creado para la vista en , src/Template/Cars/index.ctp. la ruta en el script es correcta: $(document).ready(function(){ $('#autocomplete').autocomplete({ source: "/cars/index.json", }); }); finalmente te paso la pertaña network <https://lh3.googleusercontent.com/-2kiB-wJjJGY/VhYWOcbmc-I/eJM/7_r3HcpdTQo/s1600/Captura%2Bde%2B2015-10-08%2B09%253A06%253A59.png> El dijous, 8 octubre de 2015 0:57:13 UTC+2, Christian Quispe va escriure: > > Ya veo, el problema viene por la vista, tienes el archivo creado en la > vista?, si usas solo controlador debes tener > > $this->set('_serialize', ['articles']); > > tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede > hacer conflicto > pasame un pantallazo de la pestaña Network, el ultimo item debe ser el > request, subpestaña preview > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* > > *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores > constantemente...* > > > 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala >: > >> Gracias Christian, >> >> ya he consegido, creo, que se realice la llamada cuando escribo algo en >> el input >> >> >> <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> >> >> >> pero siguen sin autocompletarse. >> Ahora cuando escribo la misma url ( >> http://localhost:8765/cars/index.json?term=fo) directamente en el >> navegador, me responde: >> >> { >> "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is missing.", >> "url": "\/cars\/index.json?term=fo", >> "code": 500 >> } >> >> >> >> saludos >> >> El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va >> escriure: >>> >>> Hola Raul >>> Nos compares los debugs? o algún pantallazo de la consola de chromeDev >>> cuando intentas ejecutarlo >>> >>> >>> >>> Enviado con MailTrack >>> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >>> >>> Saludos >>> >>> Christian Quispe >>> >>> *Geek and Developer* >>> *Miembro: * *GDG Lima (Google Developer Group Lima)* >>> >>> *Portafolio: www.oxicode.io >>> <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63>* >>> >>> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >>> constantemente...* >>> >>> >>> 2015-10-07 16:42 GMT-05:00 Raul Magdalena Catala : >>> >>>> Hello, >>>> i'm trying to use the following example of JQuery autocomplete with >>>> Cakephp >>>> >>>> >>>> http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ >>>> >>>> The important change between versions (if i'm not wrong) is how to >>>> enable the parsing of extensions >>>> >>>> in both cases it is done in the ruotes.php file >>>> in 2.3 by Router::parseExtensions() >>>> in 3.0 by Router::extensions('json') >>>> >>>> anyway, when i write into the input, nothing happens >>>> i've checked with the browser debugging tool and no call to >>>> http://localhost:8765/cars/index.json occurs. >>>> even if i write the url http://localhost:8765/cars/index.json?term=fo >>>> in the browser, i do not receive a json response, in fact no response or >>>> error message >>>> >>>> any idea about what i'm doing wrong? >>>> >>>> -- >>>> Like Us on FaceBook https://www.facebook.com/CakePHP >>>> Find us on Twitter http://twitter.com/CakePHP >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "CakePHP" group. >>>
Re: JQuery autocomplete on Cakephp 3.0
Ya veo, el problema viene por la vista, tienes el archivo creado en la vista?, si usas solo controlador debes tener $this->set('_serialize', ['articles']); tambien checa la ruta, la url destino, el u0022 es un ' por ahi puede hacer conflicto pasame un pantallazo de la pestaña Network, el ultimo item debe ser el request, subpestaña preview Enviado con MailTrack <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> Saludos Christian Quispe *Geek and Developer* *Miembro: * *GDG Lima (Google Developer Group Lima)* *Portafolio: www.oxicode.io <https://mailtrack.io/trace/link/8ec7b946fa3dd757dcc0aee0f3b541981f2635a3?url=http%3A%2F%2Foxicode.io&signature=1f56e26077e1b222>* *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...* 2015-10-07 17:09 GMT-05:00 Raul Magdalena Catala : > Gracias Christian, > > ya he consegido, creo, que se realice la llamada cuando escribo algo en el > input > > > <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> > > > pero siguen sin autocompletarse. > Ahora cuando escribo la misma url ( > http://localhost:8765/cars/index.json?term=fo) directamente en el > navegador, me responde: > > { > "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is missing.", > "url": "\/cars\/index.json?term=fo", > "code": 500 > } > > > > saludos > > El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va > escriure: >> >> Hola Raul >> Nos compares los debugs? o algún pantallazo de la consola de chromeDev >> cuando intentas ejecutarlo >> >> >> >> Enviado con MailTrack >> <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> >> >> Saludos >> >> Christian Quispe >> >> *Geek and Developer* >> *Miembro: * *GDG Lima (Google Developer Group Lima)* >> >> *Portafolio: www.oxicode.io >> <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63>* >> >> *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores >> constantemente...* >> >> >> 2015-10-07 16:42 GMT-05:00 Raul Magdalena Catala : >> >>> Hello, >>> i'm trying to use the following example of JQuery autocomplete with >>> Cakephp >>> >>> >>> http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ >>> >>> The important change between versions (if i'm not wrong) is how to >>> enable the parsing of extensions >>> >>> in both cases it is done in the ruotes.php file >>> in 2.3 by Router::parseExtensions() >>> in 3.0 by Router::extensions('json') >>> >>> anyway, when i write into the input, nothing happens >>> i've checked with the browser debugging tool and no call to >>> http://localhost:8765/cars/index.json occurs. >>> even if i write the url http://localhost:8765/cars/index.json?term=fo >>> in the browser, i do not receive a json response, in fact no response or >>> error message >>> >>> any idea about what i'm doing wrong? >>> >>> -- >>> Like Us on FaceBook https://www.facebook.com/CakePHP >>> Find us on Twitter http://twitter.com/CakePHP >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "CakePHP" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to cake-php+u...@googlegroups.com. >>> To post to this group, send email to cake...@googlegroups.com. >>> Visit this group at http://groups.google.com/group/cake-php. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: JQuery autocomplete on Cakephp 3.0
Gracias Christian, ya he consegido, creo, que se realice la llamada cuando escribo algo en el input <https://lh3.googleusercontent.com/-SBR0rzGlShc/VhWXCkVuB7I/eIs/h7KqDfMMpyU/s1600/Selecci%25C3%25B3_001.png> pero siguen sin autocompletarse. Ahora cuando escribo la misma url (http://localhost:8765/cars/index.json?term=fo) directamente en el navegador, me responde: { "message": "Template file \u0022Cars\/json\/index.ctp\u0022 is missing.", "url": "\/cars\/index.json?term=fo", "code": 500 } saludos El dimecres, 7 octubre de 2015 23:48:49 UTC+2, Christian Quispe va escriure: > > Hola Raul > Nos compares los debugs? o algún pantallazo de la consola de chromeDev > cuando intentas ejecutarlo > > > > Enviado con MailTrack > <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> > > Saludos > > Christian Quispe > > *Geek and Developer* > *Miembro: * *GDG Lima (Google Developer Group Lima)* > > *Portafolio: www.oxicode.io > <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63>* > > *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores > constantemente...* > > > 2015-10-07 16:42 GMT-05:00 Raul Magdalena Catala >: > >> Hello, >> i'm trying to use the following example of JQuery autocomplete with >> Cakephp >> >> >> http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ >> >> The important change between versions (if i'm not wrong) is how to enable >> the parsing of extensions >> >> in both cases it is done in the ruotes.php file >> in 2.3 by Router::parseExtensions() >> in 3.0 by Router::extensions('json') >> >> anyway, when i write into the input, nothing happens >> i've checked with the browser debugging tool and no call to >> http://localhost:8765/cars/index.json occurs. >> even if i write the url http://localhost:8765/cars/index.json?term=fo in >> the browser, i do not receive a json response, in fact no response or error >> message >> >> any idea about what i'm doing wrong? >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to cake-php+u...@googlegroups.com . >> To post to this group, send email to cake...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/cake-php. >> For more options, visit https://groups.google.com/d/optout. >> > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: JQuery autocomplete on Cakephp 3.0
Hola Raul Nos compares los debugs? o algún pantallazo de la consola de chromeDev cuando intentas ejecutarlo Enviado con MailTrack <https://mailtrack.io/install?source=signature&lang=es&referral=christian.quis...@gmail.com&idSignature=23> Saludos Christian Quispe *Geek and Developer* *Miembro: * *GDG Lima (Google Developer Group Lima)* *Portafolio: www.oxicode.io <https://mailtrack.io/trace/link/f90a24cbce9603049712749436540c6015285ce9?url=http%3A%2F%2Foxicode.io&signature=b56e083071470d63>* *¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...* 2015-10-07 16:42 GMT-05:00 Raul Magdalena Catala : > Hello, > i'm trying to use the following example of JQuery autocomplete with Cakephp > > > http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ > > The important change between versions (if i'm not wrong) is how to enable > the parsing of extensions > > in both cases it is done in the ruotes.php file > in 2.3 by Router::parseExtensions() > in 3.0 by Router::extensions('json') > > anyway, when i write into the input, nothing happens > i've checked with the browser debugging tool and no call to > http://localhost:8765/cars/index.json occurs. > even if i write the url http://localhost:8765/cars/index.json?term=fo in > the browser, i do not receive a json response, in fact no response or error > message > > any idea about what i'm doing wrong? > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
JQuery autocomplete on Cakephp 3.0
Hello, i'm trying to use the following example of JQuery autocomplete with Cakephp http://zenofcoding.com/2013/08/27/cakephp-and-jquery-auto-complete-revisited/ The important change between versions (if i'm not wrong) is how to enable the parsing of extensions in both cases it is done in the ruotes.php file in 2.3 by Router::parseExtensions() in 3.0 by Router::extensions('json') anyway, when i write into the input, nothing happens i've checked with the browser debugging tool and no call to http://localhost:8765/cars/index.json occurs. even if i write the url http://localhost:8765/cars/index.json?term=fo in the browser, i do not receive a json response, in fact no response or error message any idea about what i'm doing wrong? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Cakephp Autocomplete Tutorial ajax error
Check this: http://stackoverflow.com/questions/19911685/cakephp-trying-to-send-a-ajax-request/19938762#19938762 On Saturday, January 31, 2015 at 8:13:54 PM UTC-4, ajt wrote: > > > > In CakePHP, I am trying to create a autocomplete function from a textbox, > using this tutorial: http: > //bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2 > > > I keep getting a > > Undefined index: autoCompleteText > > > I solved the helper issue as it finds the helper as this is cakephp 1.X > code and I have 2.X > > > controller - Tests > function auto_complete > > > > class TestsController extends AppController { > > public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete'); > > public function auto_complete() { > $this->loadModel('Tutor'); > debug( $this->params); > > > $terms = $this->Tutor->find('all', array( > 'conditions' => array( > 'Tutor.first_name LIKE' => > $this->params['url']['autoCompleteText'].'%' > ), > 'fields' => array('Tutor.first_name'), > 'limit' => 3, > 'recursive'=>-1, > )); > $terms = Set::Extract($terms,'{n}.Tutor.first_name'); > $this->set('terms', $terms); > $this->layout = ''; > } > > > > view > auto_complete.ctp > > > echo $this->AutoComplete->input( > 'Tutor.first_name', > array( > 'autoCompleteUrl'=>$this->Html->url( > array( > 'controller'=>'tests', > 'action'=>'auto_complete', > ) > ), > 'autoCompleteRequestItem'=>'autoCompleteText', > ) > ); > > if(isset($terms)) { > echo $this->Js->object($terms); > } > >echo $this->Form->create(''); > > echo $this->Form->input('type', array('label' => 'Choose' )); >echo $this->Form->end('send'); > > ?> > > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Cakephp Autocomplete Tutorial ajax error
It is best not to use the JS helper(s) etc. Use just plain jQuery and it will work quite easily out of the box See http://sandbox.dereuromark.de/sandbox/ajax_examples/ for live examples mark Am Sonntag, 1. Februar 2015 01:13:54 UTC+1 schrieb ajt: > > > > In CakePHP, I am trying to create a autocomplete function from a textbox, > using this tutorial: http: > //bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2 > > > I keep getting a > > Undefined index: autoCompleteText > > > I solved the helper issue as it finds the helper as this is cakephp 1.X > code and I have 2.X > > > controller - Tests > function auto_complete > > > > class TestsController extends AppController { > > public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete'); > > public function auto_complete() { > $this->loadModel('Tutor'); > debug( $this->params); > > > $terms = $this->Tutor->find('all', array( > 'conditions' => array( > 'Tutor.first_name LIKE' => > $this->params['url']['autoCompleteText'].'%' > ), > 'fields' => array('Tutor.first_name'), > 'limit' => 3, > 'recursive'=>-1, > )); > $terms = Set::Extract($terms,'{n}.Tutor.first_name'); > $this->set('terms', $terms); > $this->layout = ''; > } > > > > view > auto_complete.ctp > > > echo $this->AutoComplete->input( > 'Tutor.first_name', > array( > 'autoCompleteUrl'=>$this->Html->url( > array( > 'controller'=>'tests', > 'action'=>'auto_complete', > ) > ), > 'autoCompleteRequestItem'=>'autoCompleteText', > ) > ); > > if(isset($terms)) { > echo $this->Js->object($terms); > } > >echo $this->Form->create(''); > > echo $this->Form->input('type', array('label' => 'Choose' )); >echo $this->Form->end('send'); > > ?> > > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Cakephp Autocomplete Tutorial ajax error
In CakePHP, I am trying to create a autocomplete function from a textbox, using this tutorial: http: //bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2 I keep getting a Undefined index: autoCompleteText I solved the helper issue as it finds the helper as this is cakephp 1.X code and I have 2.X controller - Tests function auto_complete class TestsController extends AppController { public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete'); public function auto_complete() { $this->loadModel('Tutor'); debug( $this->params); $terms = $this->Tutor->find('all', array( 'conditions' => array( 'Tutor.first_name LIKE' => $this->params['url']['autoCompleteText'].'%' ), 'fields' => array('Tutor.first_name'), 'limit' => 3, 'recursive'=>-1, )); $terms = Set::Extract($terms,'{n}.Tutor.first_name'); $this->set('terms', $terms); $this->layout = ''; } view auto_complete.ctp AutoComplete->input( 'Tutor.first_name', array( 'autoCompleteUrl'=>$this->Html->url( array( 'controller'=>'tests', 'action'=>'auto_complete', ) ), 'autoCompleteRequestItem'=>'autoCompleteText', ) ); if(isset($terms)) { echo $this->Js->object($terms); } echo $this->Form->create(''); echo $this->Form->input('type', array('label' => 'Choose' )); echo $this->Form->end('send'); ?> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
CakePHP autocomplete tutorial ajax error
Hi, In CakePHP, I am trying to create a autocomplete function from a textbox, using this tutorial: http://bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2 I keep getting a Error: AutoCompleteHelper could not be found. Undefined index: autoCompleteText I am unsure how to fix this as I have tried relocating the files and still the same error. I create the below files and copy the code from the tutorial, create the auto_complete.php in the view/helpers directory, and create webroot/js/views/helpers/auto_complete.js. controller - Tests function auto_complete class TestsController extends AppController { public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete'); public function auto_complete() { $this->loadModel('Tutor'); debug( $this->params); $terms = $this->Tutor->find('all', array( 'conditions' => array( 'Tutor.first_name LIKE' => $this->params['url']['autoCompleteText'].'%' ), 'fields' => array('Tutor.first_name'), 'limit' => 3, 'recursive'=>-1, )); $terms = Set::Extract($terms,'{n}.Tutor.first_name'); $this->set('terms', $terms); $this->layout = ''; } view auto_complete.ctp AutoComplete->input( 'Tutor.first_name', array( 'autoCompleteUrl'=>$this->Html->url( array( 'controller'=>'tests', 'action'=>'auto_complete', ) ), 'autoCompleteRequestItem'=>'autoCompleteText', ) ); if(isset($terms)) { echo $this->Js->object($terms); } echo $this->Form->create(''); echo $this->Form->input('type', array('label' => 'Choose' )); echo $this->Form->end('send'); ?> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: cant get autocomplete function to find helper class
I checked the docs and the autocomplete tutorial is for cakephp 1.X To use it for cakephp 2.X I couldnt get it to work so I am stuck -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
cant get autocomplete function to find helper class
In CakePHP, I am trying to create a autocomplete function from a textbox, using this tutorial: http://bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2 I keep getting a Error: AutoCompleteHelper could not be found. Undefined index: autoCompleteText I am unsure how to fix this as I have tried relocating the files and still the same error. I create the below files and copy the code from the tutorial, create the auto_complete.php in the view/helpers directory, and create webroot/js/views/helpers/auto_complete.js. controller - Tests function auto_complete class TestsController extends AppController { public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete'); public function auto_complete() { $this->loadModel('Tutor'); debug( $this->params); $terms = $this->Tutor->find('all', array( 'conditions' => array( 'Tutor.first_name LIKE' => $this->params['url']['autoCompleteText'].'%' ), 'fields' => array('Tutor.first_name'), 'limit' => 3, 'recursive'=>-1, )); $terms = Set::Extract($terms,'{n}.Tutor.first_name'); $this->set('terms', $terms); $this->layout = ''; } view auto_complete.ctp AutoComplete->input( 'Ttuor.first_name', array( 'autoCompleteUrl'=>$this->Html->url( array( 'controller'=>'tests', 'action'=>'auto_complete', ) ), 'autoCompleteRequestItem'=>'autoCompleteText', ) ); if(isset($terms)) { echo $this->Js->object($terms); } echo $this->Form->create(''); echo $this->Form->input('type', array('label' => 'Choose' )); echo $this->Form->end('send'); ?> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
Thank you. I have an other approach to this. I will make a plugin based on that. rrd 2014-10-02 7:44 GMT+02:00 heavyKevy : > I got the Autocomplete widget to work with the following: > > Same autocomplete widget file as you but different code in controller and > view file: > Controller: > public $helpers = [ > 'Form' => [ > 'widgets' => [ > 'autocomplete' => ['App\View\Widget\Autocomplete'] > ] > ] > ]; > > add.ctp: > echo $this->Html->css('jquery-ui.theme.css'); > echo $this->Html->script('jquery',['block'=>true]); > echo $this->Html->script('jquery-ui',['block'=>true]); > $this->Html->scriptStart(['block'=>true,'safe'=>false]); > ?> > > > $this->Html->scriptEnd(); > // Using a classname. > $this->Form->addWidget( > 'autocomplete', > ['App\View\Widget\Autocomplete'] > ); > ?> > > Form->create($purchase,['templates'=>['autocomplete' => ' id="sales_person" name="{{name}}"{{attrs}}>'], > > 'onsubmit'=>'return validateForm()']); ?> > > > echo $this->Form->input('sales_person', ['type' => > 'autocomplete','label'=>'Sales > Person','id'=>'sales_person','required'=>true]); > > Form->button(__('Submit')); ?> > Form->end(); ?> > > > > I eliminated all of the items not necessary for the example, so there are > likely errors in there, but it should give you the gist of what is needed > for the autocomplete to work. > > Regards, > --Kevin > > On Tuesday, September 30, 2014 7:33:24 PM UTC+7, Radharadhya Dasa wrote: >> >> Hi, >> >> I am trying to make an autocomplete input work on Cake 3.0 >> >> The current 3.0 cookbook gives a code example here : >> http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html >> >> If I try it I get an error message: >> *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() >> must be compatible with Cake\View\Widget\WidgetInterface::render(array >> $data, Cake\View\Form\ContextInterface $context) in >> */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line >> >> *6*If I change my render function to >> >> *public function render(array $data, Cake\View\Form\ContextInterface >> $context) {* >> Still I get the same error message. >> >> Any idea how to solve this? >> >> rrd >> > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
I got the Autocomplete widget to work with the following: Same autocomplete widget file as you but different code in controller and view file: Controller: public $helpers = [ 'Form' => [ 'widgets' => [ 'autocomplete' => ['App\View\Widget\Autocomplete'] ] ] ]; add.ctp: Html->css('jquery-ui.theme.css'); echo $this->Html->script('jquery',['block'=>true]); echo $this->Html->script('jquery-ui',['block'=>true]); $this->Html->scriptStart(['block'=>true,'safe'=>false]); ?> Html->scriptEnd(); // Using a classname. $this->Form->addWidget( 'autocomplete', ['App\View\Widget\Autocomplete'] ); ?> Form->create($purchase,['templates'=>['autocomplete' => ''], 'onsubmit'=>'return validateForm()']); ?> Form->input('sales_person', ['type' => 'autocomplete','label'=>'Sales Person','id'=>'sales_person','required'=>true]); Form->button(__('Submit')); ?> Form->end(); ?> I eliminated all of the items not necessary for the example, so there are likely errors in there, but it should give you the gist of what is needed for the autocomplete to work. Regards, --Kevin On Tuesday, September 30, 2014 7:33:24 PM UTC+7, Radharadhya Dasa wrote: > > Hi, > > I am trying to make an autocomplete input work on Cake 3.0 > > The current 3.0 cookbook gives a code example here : > http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html > > If I try it I get an error message: > *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() must > be compatible with Cake\View\Widget\WidgetInterface::render(array $data, > Cake\View\Form\ContextInterface $context) in > */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line > > *6*If I change my render function to > > *public function render(array $data, Cake\View\Form\ContextInterface > $context) {* > Still I get the same error message. > > Any idea how to solve this? > > rrd > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
Yes, you should have a form template called autocomplete which your widget is using. See http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html#customizing-the-templates-formhelper-uses and http://www.sanisoft.com/blog/2014/08/11/twitter-bootstrap-forms-cakephp-3/ Specifically Step 2 HTH T On Wed, Oct 1, 2014 at 10:01 AM, Radharadhya Dasa wrote: > > > Show us the from template for autocomplete > > I do not have anything else. Should I? > > Rrd > > > > > T > > > > On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa wrote: > >> > >> 1. /src/View/Widget/Autocomplete.php > >> > >> >> namespace App\View\Widget; > >> > >> use Cake\View\Widget\WidgetInterface; > >> use Cake\View\Form\ContextInterface; > >> > >> class Autocomplete implements WidgetInterface { > >> > >> protected $_templates; > >> > >> public function __construct($templates) { > >> $this->_templates = $templates; > >> } > >> > >> public function render(array $data, ContextInterface $context) { > >> $data += [ > >> 'name' => '', > >> ]; > >> return $this->_templates->format('autocomplete', [ > >> 'name' => $data['name'], > >> 'attrs' => $this->_templates->formatAttributes($data, > ['name']) > >> ]); > >> } > >> > >> public function secureFields(array $data){ > >>return []; > >> } > >> } > >> ?> > >> > >> 2. /src/Controller/AppController.php > >> > >> >> namespace App\Controller; > >> > >> use Cake\Controller\Controller; > >> use Cake\Event\Event; > >> > >> class AppController extends Controller { > >> > >> public $components = [ > >> 'Flash', > >> 'Auth' => [ > >> 'loginRedirect' => [ > >> 'controller' => 'users', > >> 'action' => 'view' > >> ], > >> 'logoutRedirect' => [ > >> 'controller' => 'Pages', > >> 'action' => 'display', > >> 'home' > >> ] > >> ] > >> ]; > >> > >> public $helpers = [ > >> 'Form' => [ > >> 'widgets' => [ > >> 'autocomplete' => [ > >> 'App\View\Widget\Autocomplete', > >> 'text', > >> 'label' > >> ] > >> ] > >> ] > >> ]; > >> > >> public function beforeFilter(Event $event) { > >> $this->Auth->deny(); > >> } > >> } > >> > >> > >> > >> 3. /src/Template/Contacts/add.ctp > >> > >> > >> > >> > >> Html->link(__('List Contacts'), ['action' => > 'index']) ?> > >> > >> > >> > >> Form->create($contact) ?> > >> > >> > >> >> echo $this->Form->autocomplete('name'); > >> ?> > >> > >> Form->button(__('Submit')) ?> > >> Form->end() ?> > >> > >> > >> > >> > >> Result: In the generated html there is no input for name at all. > >> > >> rrd > >> > >> > >> 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a > következőt írta: > >>> > >>> Hi, > >>> > >>> I am trying to make an autocomplete input work on Cake 3.0 > >>> > >>> The current 3.0 cookbook gives a code example here : > http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html > >>> > >>> If I try it I get an error message: > >>> Fatal error: Declaration of App\View\Widget\Autocomplete::render() > must be compatible with Cake\View\Widget\WidgetInterface::render(array > $data,
Re: CakePHP 3.0 autocomplete
> Show us the from template for autocomplete I do not have anything else. Should I? Rrd > > T > > On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa wrote: >> >> 1. /src/View/Widget/Autocomplete.php >> >> > namespace App\View\Widget; >> >> use Cake\View\Widget\WidgetInterface; >> use Cake\View\Form\ContextInterface; >> >> class Autocomplete implements WidgetInterface { >> >> protected $_templates; >> >> public function __construct($templates) { >> $this->_templates = $templates; >> } >> >> public function render(array $data, ContextInterface $context) { >> $data += [ >> 'name' => '', >> ]; >> return $this->_templates->format('autocomplete', [ >> 'name' => $data['name'], >> 'attrs' => $this->_templates->formatAttributes($data, ['name']) >> ]); >> } >> >> public function secureFields(array $data){ >>return []; >> } >> } >> ?> >> >> 2. /src/Controller/AppController.php >> >> > namespace App\Controller; >> >> use Cake\Controller\Controller; >> use Cake\Event\Event; >> >> class AppController extends Controller { >> >> public $components = [ >> 'Flash', >> 'Auth' => [ >> 'loginRedirect' => [ >> 'controller' => 'users', >> 'action' => 'view' >> ], >> 'logoutRedirect' => [ >> 'controller' => 'Pages', >> 'action' => 'display', >> 'home' >> ] >> ] >> ]; >> >> public $helpers = [ >> 'Form' => [ >> 'widgets' => [ >> 'autocomplete' => [ >> 'App\View\Widget\Autocomplete', >> 'text', >> 'label' >> ] >> ] >> ] >> ]; >> >> public function beforeFilter(Event $event) { >> $this->Auth->deny(); >> } >> } >> >> >> >> 3. /src/Template/Contacts/add.ctp >> >> >> >> >> Html->link(__('List Contacts'), ['action' => 'index']) ?> >> >> >> >> Form->create($contact) ?> >> >> >> > echo $this->Form->autocomplete('name'); >> ?> >> >> Form->button(__('Submit')) ?> >> Form->end() ?> >> >> >> >> >> Result: In the generated html there is no input for name at all. >> >> rrd >> >> >> 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a következőt írta: >>> >>> Hi, >>> >>> I am trying to make an autocomplete input work on Cake 3.0 >>> >>> The current 3.0 cookbook gives a code example here : http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html >>> >>> If I try it I get an error message: >>> Fatal error: Declaration of App\View\Widget\Autocomplete::render() must be compatible with Cake\View\Widget\WidgetInterface::render(array $data, Cake\View\Form\ContextInterface $context) in /home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php on line 6 >>> >>> If I change my render function to >>> public function render(array $data, Cake\View\Form\ContextInterface $context) { >>> >>> Still I get the same error message. >>> >>> Any idea how to solve this? >>> >>> rrd >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups "CakePHP" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. >> To post to this group, send email to cake-php@googlegroups.com. >> Visit this group at http://groups.google.com/group/cake-php. >> For more options, visit https://groups.google.com/d/optout. > > > > > -- > = > Hire a CakePHP dev team : http://sanisoft.com > = > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
Show us the from template for autocomplete T On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa wrote: > 1. /src/View/Widget/Autocomplete.php > > namespace App\View\Widget; > > use Cake\View\Widget\WidgetInterface; > use Cake\View\Form\ContextInterface; > > class Autocomplete implements WidgetInterface { > > protected $_templates; > > public function __construct($templates) { > $this->_templates = $templates; > } > > public function render(array $data, ContextInterface $context) { > $data += [ > 'name' => '', > ]; > return $this->_templates->format('autocomplete', [ > 'name' => $data['name'], > 'attrs' => $this->_templates->formatAttributes($data, ['name' > ]) > ]); > } > > public function secureFields(array $data){ >return []; > } > } > ?> > > 2. /src/Controller/AppController.php > > namespace App\Controller; > > use Cake\Controller\Controller; > use Cake\Event\Event; > > class AppController extends Controller { > > public $components = [ > 'Flash', > 'Auth' => [ > 'loginRedirect' => [ > 'controller' => 'users', > 'action' => 'view' > ], > 'logoutRedirect' => [ > 'controller' => 'Pages', > 'action' => 'display', > 'home' > ] > ] > ]; > > public $helpers = [ > 'Form' => [ > 'widgets' => [ > 'autocomplete' => [ > 'App\View\Widget\Autocomplete', > 'text', > 'label' > ] > ] > ] > ]; > > public function beforeFilter(Event $event) { > $this->Auth->deny(); > } > } > > > > 3. /src/Template/Contacts/add.ctp > > > > > Html->link(__('List Contacts'), ['action' => > 'index']) ?> > > > > Form->create($contact) ?> > > > echo $this->Form->autocomplete('name'); > ?> > > Form->button(__('Submit')) ?> > Form->end() ?> > > > > > Result: In the generated html there is no input for name at all. > > rrd > > > 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a > következőt írta: > >> Hi, >> >> I am trying to make an autocomplete input work on Cake 3.0 >> >> The current 3.0 cookbook gives a code example here : >> http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html >> >> If I try it I get an error message: >> *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() >> must be compatible with Cake\View\Widget\WidgetInterface::render(array >> $data, Cake\View\Form\ContextInterface $context) in >> */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line >> >> *6*If I change my render function to >> >> *public function render(array $data, Cake\View\Form\ContextInterface >> $context) {* >> Still I get the same error message. >> >> Any idea how to solve this? >> >> rrd >> > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- = Hire a CakePHP dev team : http://sanisoft.com = -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
1. /src/View/Widget/Autocomplete.php _templates = $templates; } public function render(array $data, ContextInterface $context) { $data += [ 'name' => '', ]; return $this->_templates->format('autocomplete', [ 'name' => $data['name'], 'attrs' => $this->_templates->formatAttributes($data, ['name']) ]); } public function secureFields(array $data){ return []; } } ?> 2. /src/Controller/AppController.php [ 'loginRedirect' => [ 'controller' => 'users', 'action' => 'view' ], 'logoutRedirect' => [ 'controller' => 'Pages', 'action' => 'display', 'home' ] ] ]; public $helpers = [ 'Form' => [ 'widgets' => [ 'autocomplete' => [ 'App\View\Widget\Autocomplete', 'text', 'label' ] ] ] ]; public function beforeFilter(Event $event) { $this->Auth->deny(); } } 3. /src/Template/Contacts/add.ctp Html->link(__('List Contacts'), ['action' => 'index' ]) ?> Form->create($contact) ?> Form->autocomplete('name'); ?> Form->button(__('Submit')) ?> Form->end() ?> Result: In the generated html there is no input for name at all. rrd 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a következőt írta: > > Hi, > > I am trying to make an autocomplete input work on Cake 3.0 > > The current 3.0 cookbook gives a code example here : > http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html > > If I try it I get an error message: > *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() must > be compatible with Cake\View\Widget\WidgetInterface::render(array $data, > Cake\View\Form\ContextInterface $context) in > */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line > > *6*If I change my render function to > > *public function render(array $data, Cake\View\Form\ContextInterface > $context) {* > Still I get the same error message. > > Any idea how to solve this? > > rrd > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
I would have to see your code to understand what your are doing On Tuesday, September 30, 2014 3:17:26 PM UTC+2, Radharadhya Dasa wrote: > > Thank you. Silly things sometimes hard to find... > > echo $this->Form->autocomplete('name'); > > Now I do not have any error message but no code is generated the above > code do not echoes anyting. I am pretty sure that I missed something simple. > > 1. I created /src/View/Widget/Autocomplete.php > 2. Added the $heépers property to AppController.php > 3. Used echo $this->Form->autocomplete > > What is missing? Why there is no error message? > > rrd > > 2014-09-30 14:41 GMT+02:00 José Lorenzo : > >> You are probably missing a "use *Cake\View\Form\ContextInterface*" at >> the top of your file >> >> >> On Tuesday, September 30, 2014 2:33:24 PM UTC+2, Radharadhya Dasa wrote: >>> >>> Hi, >>> >>> I am trying to make an autocomplete input work on Cake 3.0 >>> >>> The current 3.0 cookbook gives a code example here : >>> http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html >>> >>> If I try it I get an error message: >>> *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() >>> must be compatible with Cake\View\Widget\WidgetInterface::render(array >>> $data, Cake\View\Form\ContextInterface $context) in >>> */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line >>> >>> *6*If I change my render function to >>> >>> *public function render(array $data, Cake\View\Form\ContextInterface >>> $context) {* >>> Still I get the same error message. >>> >>> Any idea how to solve this? >>> >>> rrd >>> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to cake-php+unsubscr...@googlegroups.com. >> To post to this group, send email to cake-php@googlegroups.com. >> Visit this group at http://groups.google.com/group/cake-php. >> For more options, visit https://groups.google.com/d/optout. >> > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
Thank you. Silly things sometimes hard to find... echo $this->Form->autocomplete('name'); Now I do not have any error message but no code is generated the above code do not echoes anyting. I am pretty sure that I missed something simple. 1. I created /src/View/Widget/Autocomplete.php 2. Added the $heépers property to AppController.php 3. Used echo $this->Form->autocomplete What is missing? Why there is no error message? rrd 2014-09-30 14:41 GMT+02:00 José Lorenzo : > You are probably missing a "use *Cake\View\Form\ContextInterface*" at the > top of your file > > > On Tuesday, September 30, 2014 2:33:24 PM UTC+2, Radharadhya Dasa wrote: >> >> Hi, >> >> I am trying to make an autocomplete input work on Cake 3.0 >> >> The current 3.0 cookbook gives a code example here : >> http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html >> >> If I try it I get an error message: >> *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() >> must be compatible with Cake\View\Widget\WidgetInterface::render(array >> $data, Cake\View\Form\ContextInterface $context) in >> */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line >> >> *6*If I change my render function to >> >> *public function render(array $data, Cake\View\Form\ContextInterface >> $context) {* >> Still I get the same error message. >> >> Any idea how to solve this? >> >> rrd >> > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 3.0 autocomplete
You are probably missing a "use *Cake\View\Form\ContextInterface*" at the top of your file On Tuesday, September 30, 2014 2:33:24 PM UTC+2, Radharadhya Dasa wrote: > > Hi, > > I am trying to make an autocomplete input work on Cake 3.0 > > The current 3.0 cookbook gives a code example here : > http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html > > If I try it I get an error message: > *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() must > be compatible with Cake\View\Widget\WidgetInterface::render(array $data, > Cake\View\Form\ContextInterface $context) in > */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line > > *6*If I change my render function to > > *public function render(array $data, Cake\View\Form\ContextInterface > $context) {* > Still I get the same error message. > > Any idea how to solve this? > > rrd > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
CakePHP 3.0 autocomplete
Hi, I am trying to make an autocomplete input work on Cake 3.0 The current 3.0 cookbook gives a code example here : http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html If I try it I get an error message: *Fatal error*: Declaration of App\View\Widget\Autocomplete::render() must be compatible with Cake\View\Widget\WidgetInterface::render(array $data, Cake\View\Form\ContextInterface $context) in */home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php* on line *6*If I change my render function to *public function render(array $data, Cake\View\Form\ContextInterface $context) {* Still I get the same error message. Any idea how to solve this? rrd -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Autocomplete version 2.5
Hi, Would you like autocomplete in cakephp version 2.5, I've tried several tutorials and could not, can someone help me? a hint which that thing. I thank -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: autoComplete with jquery in cake 1.3
i got same problem, pls help thanks Pada Selasa, 29 Januari 2013 17:31:02 UTC+7, Chris menulis: > > hi guys,.. can you help me please,... > I'm in cake 1.3 and using jquery libraries > > I got all setup, including jquery.autocomplete.min.js from Ajax Javascript > helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... > I can see the "fistnames" in autocomplete form field, but I can't select > them,... > > how can I fix this...? > > this is my form: > > Form->create('User'); ?> > > > autoComplete('User.firstname', '/users/autoComplete', > array('label' => false)); ?> > > > > Form->end(__('Search', true)); ?> > > > > this is my function: > > function autoComplete() { > > $this->set('members', $this->User->find('all', array( > 'conditions' => array( > 'User.firstname LIKE' => $this->params['url']['q'].'%' > ), > 'fields' => array('firstname') > ))); > $this->layout = 'ajax'; > } > > and this is auto_complete.ctp file: > > > > > > > > > > thanks in advance > chris > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
filter multiple fields problem in autoComplete cake 1.3
hi guys,... can anyone help please,... I'm using cake 1.3 I have a autoComplete form where I want to search and filter/results members by 'firstname', 'lastname', and 'city',... It only works with 'firstname' : e.g. here is the form: Form->create('User', array('url' => '/search', 'id' => 'PageID')); ?> Ajax->autoComplete('User.name', '/users/autoComplete', array('label' => false)); ?> Form->submit('magnifier.png'); ?> Form->end(); ?> here is auto_complete.ctp: and controller functions: function autoComplete() { $this->set('members', $this->User->find('all', array( 'conditions' => array('User.token IS NULL', 'OR' => array( 'User.firstname LIKE' => $this->params['url']['q'].'%', 'User.lastname LIKE' => $this->params['url']['q'].'%', 'User.city LIKE' => $this->params['url']['q'].'%' )), 'limit' => $this->params['url']['limit'], 'fields' => array('firstname', 'lastname', 'city') ))); $this->layout = 'ajax'; } function search() { . . $this->paginate = array('User' => array('conditions' => array('User.token IS NULL', 'User.firstname LIKE'=>'%'.$this->data['User']['name'].'%'))); } HOWEVER when I add $member['User']['lastname'] . ' ' . $member['User']['city'] in auto_complete.ctp I can NOT filter results in function search(),... here is what I have already tried: function search() { ... ... // $this->paginate = array('User' => array('conditions' => array('User.token IS NULL', 'fields' => array('User.firstname LIKE'=>$this->data['User']['name'].'%', 'User.lastname LIKE'=>$this->data['User']['name'].'%', 'User.city LIKE'=>$this->data['User']['name'].'%') ))); // $this->paginate = array('User' => array('conditions' => array('User.token IS NULL', 'User.firstname LIKE'=>$this->data['User']['name'].'%', 'fields' => array('firstname', 'lastname', 'city') ))); // $this->paginate = array('User' => array('conditions' => array('User.token IS NULL', 'OR' => array('User.firstname LIKE' => $this->data['User']['name'].'%', 'User.lastname LIKE' => $this->data['User']['name'].'%', 'User.city LIKE' => $this->data['User']['name'].'%') ))); // $this->paginate = array('User' => array('conditions' => array('User.token IS NULL', 'User.firstname LIKE'=>'%'.$this->data['User']['name'].'%', 'User.lastname LIKE'=>'%'.$this->data['User']['name'].'%', 'User.city LIKE'=>'%'.$this->data['User']['name'].'%'))); } how can I do this please,...? thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: autocomplete issue in cake 1.3
sorry guys,... I misstyped form,... this is the right one: Form->create('User', array('url' => '/users/search')); ?> Ajax->autoComplete('User.name', '/users/autoComplete', array('label' => false)); ?> Form->end(__('Search', true)); ?> On Friday, February 22, 2013 4:30:42 PM UTC-8, Chris wrote: > > hi guys,... can someone help please,... I have a autocomplete issue in > cake 1.3 > I'm using jquery helper from http://www.cakephp.4uk.pl/ajax/autoComplete > I manage to see the results in form field, > > this is my search.ctp file: > > > > Form->create('User', array('action' => 'search')); ?> > Form->text('firstname', array('style' => 'width: 60px')) > ?> > > Form->text('User.email', array('style' => 'width: > 60px')) ?> > > Form->text('User.city', array('style' => 'width: 60px')) > ?> > Form->end(__('Search', true)); ?> > > > > > link($profileShow->buddy($user_obj), '/profile/' . > $user_obj['User']['username'], array('escape'=>false)) ?> > <.div> > > > this is auto_complete.ctp > > > $member['User']['lastname'] . "\n" ?> > > > > > this is my controller functions: > > function autoComplete() { > > $this->set('members', $this->User->find('all', array( > 'conditions' => array( > 'OR' => array( > 'User.firstname LIKE' => > $this->params['url']['q'].'%', > 'User.lastname LIKE' => $this->params['url']['q'].'%' > )), > 'fields' => array('firstname', 'lastname') > ))); > $this->layout = 'ajax'; > } > > function search() > { > $this->User->recursive = 0; > $this->set('users', $this->paginate()); > > } > > I can see ALL users with pagination in that page, but not the user that I > search... > Please help,... > > Thanks in advance > chris > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
autocomplete issue in cake 1.3
hi guys,... can someone help please,... I have a autocomplete issue in cake 1.3 I'm using jquery helper from http://www.cakephp.4uk.pl/ajax/autoComplete I manage to see the results in form field, this is my search.ctp file: Form->create('User', array('action' => 'search')); ?> Form->text('firstname', array('style' => 'width: 60px')) ?> Form->text('User.email', array('style' => 'width: 60px')) ?> Form->text('User.city', array('style' => 'width: 60px')) ?> Form->end(__('Search', true)); ?> link($profileShow->buddy($user_obj), '/profile/' . $user_obj['User']['username'], array('escape'=>false)) ?> <.div> this is auto_complete.ctp this is my controller functions: function autoComplete() { $this->set('members', $this->User->find('all', array( 'conditions' => array( 'OR' => array( 'User.firstname LIKE' => $this->params['url']['q'].'%', 'User.lastname LIKE' => $this->params['url']['q'].'%' )), 'fields' => array('firstname', 'lastname') ))); $this->layout = 'ajax'; } function search() { $this->User->recursive = 0; $this->set('users', $this->paginate()); } I can see ALL users with pagination in that page, but not the user that I search... Please help,... Thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: autoComplete with jquery in cake 1.3
This is not a CakePHP issue. Most likely a javascript / CSS issue, I'd bet javascript. On Tuesday, January 29, 2013 5:31:02 AM UTC-5, Chris wrote: > > hi guys,.. can you help me please,... > I'm in cake 1.3 and using jquery libraries > > I got all setup, including jquery.autocomplete.min.js from Ajax Javascript > helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... > I can see the "fistnames" in autocomplete form field, but I can't select > them,... > > how can I fix this...? > > this is my form: > > Form->create('User'); ?> > > > autoComplete('User.firstname', '/users/autoComplete', > array('label' => false)); ?> > > > > Form->end(__('Search', true)); ?> > > > > this is my function: > > function autoComplete() { > > $this->set('members', $this->User->find('all', array( > 'conditions' => array( > 'User.firstname LIKE' => $this->params['url']['q'].'%' > ), > 'fields' => array('firstname') > ))); > $this->layout = 'ajax'; > } > > and this is auto_complete.ctp file: > > > > > > > > > > thanks in advance > chris > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: autoComplete with jquery in cake 1.3
hi cricket,... thank you for your reply,... I did install Firebug,... and I don't see any errors,... is there a way I can contact you? What's you website or contact info,... On Tuesday, January 29, 2013 2:56:10 PM UTC-8, cricket wrote: > > If you're seeing the results then it isn't a Cake problem. I'd guess > CSS, probably with the floats. Have you tried installing Firebug? > > On Tue, Jan 29, 2013 at 5:31 AM, Chris > > wrote: > > hi guys,.. can you help me please,... > > I'm in cake 1.3 and using jquery libraries > > > > I got all setup, including jquery.autocomplete.min.js from Ajax > Javascript > > helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... > > I can see the "fistnames" in autocomplete form field, but I can't select > > them,... > > > > how can I fix this...? > > > > this is my form: > > > > Form->create('User'); ?> > > > > > > autoComplete('User.firstname', '/users/autoComplete', > > array('label' => false)); ?> > > > > > > > > Form->end(__('Search', true)); ?> > > > > > > > > this is my function: > > > > function autoComplete() { > > > > $this->set('members', $this->User->find('all', array( > > 'conditions' => array( > > 'User.firstname LIKE' => $this->params['url']['q'].'%' > > ), > > 'fields' => array('firstname') > > ))); > > $this->layout = 'ajax'; > > } > > > > and this is auto_complete.ctp file: > > > > > > > > > > > > > > > > > > > > thanks in advance > > chris > > > > -- > > Like Us on FaceBook https://www.facebook.com/CakePHP > > Find us on Twitter http://twitter.com/CakePHP > > > > --- > > You received this message because you are subscribed to the Google > Groups > > "CakePHP" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to cake-php+u...@googlegroups.com . > > To post to this group, send email to cake...@googlegroups.com. > > > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: autoComplete with jquery in cake 1.3
If you're seeing the results then it isn't a Cake problem. I'd guess CSS, probably with the floats. Have you tried installing Firebug? On Tue, Jan 29, 2013 at 5:31 AM, Chris wrote: > hi guys,.. can you help me please,... > I'm in cake 1.3 and using jquery libraries > > I got all setup, including jquery.autocomplete.min.js from Ajax Javascript > helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... > I can see the "fistnames" in autocomplete form field, but I can't select > them,... > > how can I fix this...? > > this is my form: > > Form->create('User'); ?> > > > autoComplete('User.firstname', '/users/autoComplete', > array('label' => false)); ?> > > > > Form->end(__('Search', true)); ?> > > > > this is my function: > > function autoComplete() { > > $this->set('members', $this->User->find('all', array( > 'conditions' => array( > 'User.firstname LIKE' => $this->params['url']['q'].'%' > ), > 'fields' => array('firstname') > ))); > $this->layout = 'ajax'; > } > > and this is auto_complete.ctp file: > > > > > > > > > > thanks in advance > chris > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
autoComplete with jquery in cake 1.3
hi guys,.. can you help me please,... I'm in cake 1.3 and using jquery libraries I got all setup, including jquery.autocomplete.min.js from Ajax Javascript helper http://www.cakephp.4uk.pl/ajax/autoComplete ,... I can see the "fistnames" in autocomplete form field, but I can't select them,... how can I fix this...? this is my form: Form->create('User'); ?> autoComplete('User.firstname', '/users/autoComplete', array('label' => false)); ?> Form->end(__('Search', true)); ?> this is my function: function autoComplete() { $this->set('members', $this->User->find('all', array( 'conditions' => array( 'User.firstname LIKE' => $this->params['url']['q'].'%' ), 'fields' => array('firstname') ))); $this->layout = 'ajax'; } and this is auto_complete.ctp file: thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: CakePHP 2.2 and Autocomplete Jquery
This code snippet needs refactoring in order to use JsHelper, but it works: controller code (Controllers/PeopleController.php): function autoComplete() { $this->autoRender = false; $search_string = trim($this->request->query['term']); if (!is_null($search_string) && $search_string != '') { $people = $this->Person->find('all', array( 'conditions' => array ( 'OR' => array ( 'Person.first_name LIKE' => '%' . $search_string . '%', 'Person.last_name LIKE'=> '%' . $search_string . '%', 'Person.family_info LIKE' => '%' . $search_string . '%', 'Person.comments LIKE' => '%' . $search_string . '%', 'Person.home_street LIKE' => '%' . $search_string . '%', 'Person.work_street_1 LIKE'=> '%' . $search_string . '%', 'Person.work_street_2 LIKE'=> '%' . $search_string . '%' ) ), 'fields' => array( 'Person.first_name', 'Person.last_name', 'Person.active', 'Person.requested_do_not_call', 'Person.home_street', 'Person.home_city', 'Person.home_state', 'Person.home_zip', 'Person.work_street_1', 'Person.work_street_2', 'Person.work_city', 'Person.work_state', 'Person.work_zip', 'Person.id', 'Person.home_phone', 'Person.mobile_phone', 'Person.tty', 'Person.video_phone', 'Person.email' ), 'order' => array( 'Person.active DESC', 'Person.last_name ASC', 'Person.first_name ASC' ), 'recursive' => 0 ) ); $i=0; foreach($people as $person){ $response[$i]['id'] = $person['Person']['id']; $response[$i]['label'] = $person['Person']['last_name'] . ', ' . $person['Person']['first_name']; $response[$i]['value'] = $person['Person']['last_name'] . ', ' . $person['Person']['first_name']; $i++; } echo json_encode($response); } } view code (Views/People/search.ctp): Html->script('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array('inline' => false)); echo $this->Html->script('https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.js', array('inline' => false)); echo $this->Html->script('autocomplete/jquery.ui.autocomplete.html.js', array('inline' => false)); ob_start(); ?> $(document).ready(function(){ $("#PersonQ").autocomplete({ source: "../people/autoComplete.json", minLength: 2 }); $("input:submit").button(); $("#PersonQ").autocomplete({ select: function(event, ui) { selected_id = ui.item.id; $('#PersonSearchForm').append(''); $('#PersonSearchForm').submit(); } }); $("#PersonQ").autocomplete({ open: function(event, ui) { $('#PersonId').remove(); } }); }); Html->scriptBlock($jscript, array('inline' => false)); ?> On Tuesday, November 20, 2012 5:34:56 AM UTC-5, franscelstain wrote: > > if anyone can give an example? > > Pada Senin, 12 November 2012 11:01:40 UTC+7, franscelstain menulis: >> >> Is there someone who can help me make jquery autocomplete using CakePHP >> 2.2 >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP 2.2 and Autocomplete Jquery
Attach jquery ui autocomplete to your page. Then change the 'source' to your controller's action(output in json). make sure the json output have id and label field. sample json output for autocomplete http://gimmebucks.asia/tafsir/keywords/getlist.json?term=sahabat On Tuesday, 20 November 2012 18:34:56 UTC+8, franscelstain wrote: > > if anyone can give an example? > > Pada Senin, 12 November 2012 11:01:40 UTC+7, franscelstain menulis: >> >> Is there someone who can help me make jquery autocomplete using CakePHP >> 2.2 >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP 2.2 and Autocomplete Jquery
if anyone can give an example? Pada Senin, 12 November 2012 11:01:40 UTC+7, franscelstain menulis: > > Is there someone who can help me make jquery autocomplete using CakePHP 2.2 > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP 2.2 and Autocomplete Jquery
I think it's only JavaScript problem, not PHP. Понеділок, 12 листопада 2012 р. 06:01:40 UTC+2 користувач franscelstain написав: > > Is there someone who can help me make jquery autocomplete using CakePHP 2.2 > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
CakePHP 2.2 and Autocomplete Jquery
Is there someone who can help me make jquery autocomplete using CakePHP 2.2 -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Autocomplete field to populate a select input example?
Can you show a complete script to me because I was a beginner and I want to learn Pada Selasa, 03 Juli 2012 14:51:08 UTC+7, Michael menulis: > > I got it working. Thanks. > > On Tue, Jul 3, 2012 at 12:37 AM, Борислав Събев > > > wrote: > >> Hi there. >> >> I am assuming that you've got he autocomplete working. So what you >> basically need to do is to make an ajax call to retrieve all cities in that >> state once it is entered. >> The ajax call should call some controller method that searches for and >> returns the cities (in the selected state) in json for example. Once it has >> completed you populate the select box. >> You will need to do this on every change of the "State" field. >> >> >> On Monday, 2 July 2012 16:39:05 UTC+3, Michael wrote: >>> >>> So I have an auto-complete field where you can type in the name of a >>> state, and once it fills in the field, I want it to show another select >>> input which is populated by all the cities in that state. Does anyone have >>> a link to a tutorial or example of this? It will save me having to hack it >>> together. Thanks >>> >>> >>> ~Michael >>> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> To unsubscribe from this group, send email to >> cake-php+u...@googlegroups.com For more options, visit >> this group at http://groups.google.com/group/cake-php >> > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Autocomplete example for cakephp 2.2
Hi Greg, I want an example for cakephp 2.1.x or 2.2.x. Thanks On Wednesday, July 25, 2012 6:16:06 PM UTC+2, Greg wrote: > > I use a jQuery autocomplete control > and write a method in the desired controller which returns JSON and must > be requested as XHR ($this->request->is('ajax');) > > pretty straight forward to implement this way. Json views make it > ridiculously straight forward (just a bit of config really) > > if you are still stuck i'll grab an example from work tomorrow and dump it > for you. > > > > On Wed, Jul 25, 2012 at 11:27 PM, euromark wrote: > >> Although the description might be german, the example itself should be >> understandable: >> >> http://www.cakephp-forum.de/tutorials-und-snippets/autocomplete-mit-jquery-t1211.html >> >> >> >> Am Mittwoch, 25. Juli 2012 14:48:37 UTC+2 schrieb Dr. Tarique Sani: >> >>> Keep your js separate from the php and any solution will work. >>> >>> Tell us what specifically is not working >>> >>> Cheers >>> Tarique >>> >>> On Wed, Jul 25, 2012 at 6:40 AM, Christopher von Hessert >>> wrote: >>> > Hi, I'm looking all over google for a way to implement a Autocomplete >>> input >>> > field with no luck. All examples I have found are for cakephp < 1.3 >>> > >>> > Does anyone have a working example for cakephp 2.2? >>> > >>> > Thanks. >>> > >>> > -- >>> > Our newest site for the community: CakePHP Video Tutorials >>> > http://tv.cakephp.org >>> > Check out the new CakePHP Questions site http://ask.cakephp.org and >>> help >>> > others with their CakePHP related questions. >>> > >>> > >>> > To unsubscribe from this group, send email to >>> > cake-php+unsubscribe@**googlegroups.comFor >>> > more options, visit this group at >>> > http://groups.google.com/**group/cake-php<http://groups.google.com/group/cake-php> >>> > >>> >>> >>> >>> -- >>> ==**==**= >>> PHP for E-Biz: http://sanisoft.com >>> ==**==**= >>> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> 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 >> > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete example for cakephp 2.2
I use a jQuery autocomplete control and write a method in the desired controller which returns JSON and must be requested as XHR ($this->request->is('ajax');) pretty straight forward to implement this way. Json views make it ridiculously straight forward (just a bit of config really) if you are still stuck i'll grab an example from work tomorrow and dump it for you. On Wed, Jul 25, 2012 at 11:27 PM, euromark wrote: > Although the description might be german, the example itself should be > understandable: > > http://www.cakephp-forum.de/tutorials-und-snippets/autocomplete-mit-jquery-t1211.html > > > > Am Mittwoch, 25. Juli 2012 14:48:37 UTC+2 schrieb Dr. Tarique Sani: > >> Keep your js separate from the php and any solution will work. >> >> Tell us what specifically is not working >> >> Cheers >> Tarique >> >> On Wed, Jul 25, 2012 at 6:40 AM, Christopher von Hessert >> wrote: >> > Hi, I'm looking all over google for a way to implement a Autocomplete >> input >> > field with no luck. All examples I have found are for cakephp < 1.3 >> > >> > Does anyone have a working example for cakephp 2.2? >> > >> > Thanks. >> > >> > -- >> > Our newest site for the community: CakePHP Video Tutorials >> > http://tv.cakephp.org >> > Check out the new CakePHP Questions site http://ask.cakephp.org and >> help >> > others with their CakePHP related questions. >> > >> > >> > To unsubscribe from this group, send email to >> > cake-php+unsubscribe@**googlegroups.comFor >> > more options, visit this group at >> > http://groups.google.com/**group/cake-php<http://groups.google.com/group/cake-php> >> >> >> >> -- >> ==**==**= >> PHP for E-Biz: http://sanisoft.com >> ==**==**= >> > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete example for cakephp 2.2
Although the description might be german, the example itself should be understandable: http://www.cakephp-forum.de/tutorials-und-snippets/autocomplete-mit-jquery-t1211.html Am Mittwoch, 25. Juli 2012 14:48:37 UTC+2 schrieb Dr. Tarique Sani: > > Keep your js separate from the php and any solution will work. > > Tell us what specifically is not working > > Cheers > Tarique > > On Wed, Jul 25, 2012 at 6:40 AM, Christopher von Hessert > wrote: > > Hi, I'm looking all over google for a way to implement a Autocomplete > input > > field with no luck. All examples I have found are for cakephp < 1.3 > > > > Does anyone have a working example for cakephp 2.2? > > > > Thanks. > > > > -- > > Our newest site for the community: CakePHP Video Tutorials > > http://tv.cakephp.org > > Check out the new CakePHP Questions site http://ask.cakephp.org and > help > > others with their CakePHP related questions. > > > > > > 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 > > > > -- > = > PHP for E-Biz: http://sanisoft.com > = > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete example for cakephp 2.2
Keep your js separate from the php and any solution will work. Tell us what specifically is not working Cheers Tarique On Wed, Jul 25, 2012 at 6:40 AM, Christopher von Hessert wrote: > Hi, I'm looking all over google for a way to implement a Autocomplete input > field with no luck. All examples I have found are for cakephp < 1.3 > > Does anyone have a working example for cakephp 2.2? > > Thanks. > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- = PHP for E-Biz: http://sanisoft.com = -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Autocomplete example for cakephp 2.2
Hi, I'm looking all over google for a way to implement a Autocomplete input field with no luck. All examples I have found are for cakephp < 1.3 Does anyone have a working example for cakephp 2.2? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete field to populate a select input example?
I got it working. Thanks. On Tue, Jul 3, 2012 at 12:37 AM, Борислав Събев wrote: > Hi there. > > I am assuming that you've got he autocomplete working. So what you > basically need to do is to make an ajax call to retrieve all cities in that > state once it is entered. > The ajax call should call some controller method that searches for and > returns the cities (in the selected state) in json for example. Once it has > completed you populate the select box. > You will need to do this on every change of the "State" field. > > > On Monday, 2 July 2012 16:39:05 UTC+3, Michael wrote: >> >> So I have an auto-complete field where you can type in the name of a >> state, and once it fills in the field, I want it to show another select >> input which is populated by all the cities in that state. Does anyone have >> a link to a tutorial or example of this? It will save me having to hack it >> together. Thanks >> >> >> ~Michael >> > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete field to populate a select input example?
Hi there. I am assuming that you've got he autocomplete working. So what you basically need to do is to make an ajax call to retrieve all cities in that state once it is entered. The ajax call should call some controller method that searches for and returns the cities (in the selected state) in json for example. Once it has completed you populate the select box. You will need to do this on every change of the "State" field. On Monday, 2 July 2012 16:39:05 UTC+3, Michael wrote: > > So I have an auto-complete field where you can type in the name of a > state, and once it fills in the field, I want it to show another select > input which is populated by all the cities in that state. Does anyone have > a link to a tutorial or example of this? It will save me having to hack it > together. Thanks > > > ~Michael > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Autocomplete field to populate a select input example?
So I have an auto-complete field where you can type in the name of a state, and once it fills in the field, I want it to show another select input which is populated by all the cities in that state. Does anyone have a link to a tutorial or example of this? It will save me having to hack it together. Thanks ~Michael -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Cakephp1.3 autocomplete problem
Hello all , I need some help on autocomplete, I want to fetch merchant names from database. Here is my code. controller set('title_for_layout', 'Select Merchant: Loyalty card'); $this->set('merchant', $this->Merchant->find('all')); } function autoComplete() { $this->set('merchants', $this->Merchant->find('all', array( 'conditions' => array( 'Merchant.name LIKE' => '%a%' ) ))); $this->layout = 'ajax'; } function beforeFilter() { $this->Auth->allow('*'); } } model class Merchant extends AppModel { var $name = 'Merchant'; } views index.ctp create('Merchant', array('url' => '/merchants/index')); ?> autoComplete('Merchant.name', '/merchants/autoComplete')?> end('find')?> autocomplete.ctp Is there anything wrong in this code , following all steps from cake documentation , i am using cakephp version 1.3 Thanks in advance, Mangesh Sathe -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
autocomplete
Hi, I having problem with an autocomplete function. I have a form with a search input. Via jquery I catch the submit function and do a $.post(); to my search controller/action which returns the found data to a view via $this->set(compact('data')); I used this->layout = 'ajax'; And here is my problem. How can I display my template autocomplete.ctp as div within my layout? For now it exits only "behind the scenes". Somehow I need to make it visible... I am just lost in this... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: jquery autoComplete in cakephp 1.3
Go follow the extremely good tutorials over at jQuery UI, if you have tried and failed then by all means tell us what went wrong or you do not understand. For a CakePHP slant on how to do this try using Google: http://www.google.co.uk/search?q=cakephp+jquery+ui+autocomplete HTH, Paul On Oct 11, 12:01 pm, Eric Blanpied wrote: > I've found it quite easy with jquery UI. Something like this ought to > work in your .ctp file. Where #UserName is your field's id, and > $usernames is the list of choices. If you want your autocomplete to do > server-side lookup, check the jquery UI docs. > > > $(document).ready(function() { > $("#UserName").autocomplete({ > source: <?php echo json_encode($usernames); ?>, > }); > }); > > > you're welcome :) > > -e > > On Oct 11, 9:30 am, hoss7 wrote: > > > > > > > > > tell me best way for create autoComplete with jquery in cakephp 1.3 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: jquery autoComplete in cakephp 1.3
I've found it quite easy with jquery UI. Something like this ought to work in your .ctp file. Where #UserName is your field's id, and $usernames is the list of choices. If you want your autocomplete to do server-side lookup, check the jquery UI docs. $(document).ready(function() { $("#UserName").autocomplete({ source: <?php echo json_encode($usernames); ?>, }); }); you're welcome :) -e On Oct 11, 9:30 am, hoss7 wrote: > tell me best way for create autoComplete with jquery in cakephp 1.3 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: jquery autoComplete in cakephp 1.3
please :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: jquery autoComplete in cakephp 1.3
No matter how limited your english might be, a simple 'please' is not too hard to add. For the jQuery part you should look at the various tutorials on the web, since this is a cake group. The cake part is to add the jquery script to the .ctp file of the desired view. -flosky hoss7 schrieb: tell me best way for create autoComplete with jquery in cakephp 1.3 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
jquery autoComplete in cakephp 1.3
tell me best way for create autoComplete with jquery in cakephp 1.3 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Doubt in autocomplete jquery
Hi, Thank you for your reply. > > [{"id":1,"value":"villivakkam","label":"villivakkam", }] > I tried this too . even now i cannot view list. Regards sathia http://www.sathia27.wordpress.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Doubt in autocomplete jquery
I think you should add a "label" value to the results [{"id":1,"value":"villivakkam","label":"villivakkam",}] On 29/09/2011 19:03, Sathia S wrote: Hi, I am working in basic of autocomplete in cakephp. When i enter th text in input, i request for server and return json output (i.e) it shows result in firebug. I am not getting list in view. In view file [code] $songs_array = array(); foreach($songs as $key => $value){ array_push($songs_array, array("id"=>$key, "value" => strip_tags($value))); } echo json_encode($songs_array); [/code] It returns json as [{"id":1,"value":"villivakkam"}] when i checked in http://jsonlint.com/ it shows me valid json format. Please tell me about this issue. Thanks in advance -- Regards sathia http://www.sathia27.wordpress.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Doubt in autocomplete jquery
Hi, I am working in basic of autocomplete in cakephp. When i enter th text in input, i request for server and return json output (i.e) it shows result in firebug. I am not getting list in view. In view file [code] $songs_array = array(); foreach($songs as $key => $value){ array_push($songs_array, array("id"=>$key, "value" => strip_tags($value))); } echo json_encode($songs_array); [/code] It returns json as [{"id":1,"value":"villivakkam"}] when i checked in http://jsonlint.com/ it shows me valid json format. Please tell me about this issue. Thanks in advance -- Regards sathia http://www.sathia27.wordpress.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
AutoComplete
Hi there, AutoComplete of AjaxHelper is it working? I followed the procedure at http://book.cakephp.org/view/1370/autoComplete and never seen any effect with my web apps textfield. Prototype JavaScript and other components are properly loaded. So what is the proper steps to use to work with AutoComplete function. Please help me and I so much appreciate. Thanks. CDB -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: how can I get a label back on my autocomplete field
> echo $ajax->autoComplete('Charity.charity_name', '/charities/ > autoComplete', array('label' => 'Search for')); It works. Indeed, labeling autocomplete field is like that. :) Try to see your source code in your browser. Might be you'll find something. -- Regards,,, mastanto (thom_) http://mynameisthom.tumblr.com http://mynameisthom.blogspot.com http://www.twitter.com/mastanto_ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
how can I get a label back on my autocomplete field
Hey there, I have a search box on my cakephp 1.3 site which I've just converted into being an autocomplete field using the ajax helper. All works fine but I used to be able to label the field, ie by using this: echo $form->create("Charity",array('action' => 'search')); echo $form->input("Charity.charity_name", array('label' => 'Search for')); echo $form->end("Search"); I would have my search box with 'Search for' written above it. Now using the autocomplete helper I use: echo $form->create("Charity",array('action' => 'search')); echo $ajax->autoComplete('Charity.charity_name', '/charities/ autoComplete', array('label' => 'Search for')); echo $form->end("Search"); Unfortunately my adding array('label' => 'Search for') doesn't have the desired effect. I know there are options available for autocomplete but apparently label isn't one of them. How can I get my label back :) thanks in advance -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Autocomplete using javascript - newb question
For this one you're going to be digging into http://book.cakephp.org/view/1592/Js You'll be able to use the JS Helpler to buffer() and write() to get your javascript collected and sent out to your page. And/or you could use Html Helper script() to load javascript files. Probably you've written your form and fields using the Form Helper, so forget about struggling to set the field id to 'input_box'. Why not just cooperate with the helper which automatically sets the id to a camel case modelNameFieldName? Here's a sample of typical form helper output: so you could write: $("#GalleryLabel").autocomplete("autocomplete_ajax.cfm"); Regards Don On May 20, 7:59 am, MeatSandwich wrote: > I'm new to javascript and I'm trying to > usehttp://www.pengoworks.com/workshop/jquery/autocomplete.htmbut I don't > understand the documentation. > > I want to usehttp://code.google.com/p/searchable-behaviour-for-cakephp/ > and the box I want the autocomplete to work its magic on is the > searchable search box. > > I have no problem getting the searchable to work but in the docs for > the autocomplete it just says copy the files to the relevant places > and then use: $("selector").autocomplete(url [, options]); to make it > work. > > eg: > $("#input_box").autocomplete("autocomplete_ajax.cfm"); > In the above example, Autocomplete expects an input element with the > id "input_box" to exist. When a user starts typing in the input box, > the autocompleter will request autocomplete_ajax.cfm with a GET > parameter named q that contains the current value of the input box > > But I don't understand where I'm meant to put that bit of code. Do I > just include the js files somehow and simply name my searchable field > "input_box"? Or I'm I meant to call the js somehow in in the > controller or view or something? > > confused -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Autocomplete using javascript - newb question
I'm new to javascript and I'm trying to use http://www.pengoworks.com/workshop/jquery/autocomplete.htm but I don't understand the documentation. I want to use http://code.google.com/p/searchable-behaviour-for-cakephp/ and the box I want the autocomplete to work its magic on is the searchable search box. I have no problem getting the searchable to work but in the docs for the autocomplete it just says copy the files to the relevant places and then use: $("selector").autocomplete(url [, options]); to make it work. eg: $("#input_box").autocomplete("autocomplete_ajax.cfm"); In the above example, Autocomplete expects an input element with the id "input_box" to exist. When a user starts typing in the input box, the autocompleter will request autocomplete_ajax.cfm with a GET parameter named q that contains the current value of the input box But I don't understand where I'm meant to put that bit of code. Do I just include the js files somehow and simply name my searchable field "input_box"? Or I'm I meant to call the js somehow in in the controller or view or something? confused -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Implement AJAX Autocomplete
I'm trying with this code and can not find the error Js->buffer( $('city.nombre').autocomplete({ source: "/cities/autocomplete", }); ?> On 11 abr, 09:35, Jens Dittrich wrote: > Actually it is really simple. You need to have the > jQueryUIautocompletelibrary in your applications js folder (webroot/js), > without that, it won't work. In the view you only need a few lines of > code like: > > $this->Js->buffer( > '$("ID_OF_THE_AUTOCOMPLETE_INPUT").autocomplete({ > source: "/CONTROLLER/AUTOCOMPLETE_ACTION", > }); > ); > > Implementan action that does fetch the data forautocompletein your > controller do: > 1. check that the request isAjax() > 2. fetch the data your want in yourautocompletefield. > 3. set the data for the view (in my case I made an extra view since > the jQuery-Autocompleter expects JSON-encoded data. > 4. in the view, do an $this->Js->object(DATA_TO_ENCODE); so the data > is as expected. > > That's it. > > On 11 Apr., 05:21, tubiz wrote: > > > > > > > > > Please I have been trying toimplementtheAJAXautocompletefound in > > the Cakephp 1.3 cookbook but I havent gotten it to work. > > > There is a artist table in my database and I would like toimplement > >autocompletefor a field in the Submit action in the Lyrics controller > > > Theautocompletewill be getting the name of artist in the artist > > controller and displaying it in a text field in the Lyrics controller. > > > Would like to know how to do this and would theautocompleteaction be > > in the artist controller or in the lyrics controller. > > > Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Another AJAX Autocomplete question
Thanks, I suppose I was thinking it was harder, or more integrated than it was. Using the info you gave me, I was able to get the example here modified and working with my data. http://blogfreakz.com/cakephp/cakephp-jquery-autocomplete-tutorial/ On Apr 23, 7:11 pm, cricket wrote: > On Sat, Apr 23, 2011 at 3:25 PM, turbo2ltr wrote: > > I see there are a lot of questions about implementing AJAX > > autocomplete, but I'll be dammed if every single thing on the subject > > is woefully confusing or from the mid 2000s. > > > I go to the 1.3 cookbook under Ajax and right at the top is says > > AjaxHelper is depreciated, then it goes on to talk about those same > > things. How can the latest version of cakePHP already be depreciated? > > It's not the latest version that's deprecated, a portion of it. Pretty > normal for any software > project.http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3 > > > I've tried about 8 different implementations of ajax autocomplete that > > I've found on the web and could not get any of them to work...mostly > > because they assumed I'm smarter than I am (not step by step > > instructions, but code snippets or pseudo code), or they were written > > for an out of date version of cake. > > > Prototype? Scriptalicious? JQuery? WTF are we supposed to use? > > Pick your > poison.http://book.cakephp.org/view/1596/Javascript-engine-usage#!/view/1594... > > I recommend jQuery. > > > Actually I did get this one to sorta work, sorta: > >http://cakebaker.42dh.com/2006/06/06/autocompletion-the-easy-way/ > > As you alluded to in the beginning, that's much to old to serve as > anything but a hint. Cake has changed a lot. > > > The field I want to autocomplete is a vendor name. But in the the > > suppliers model, the vendor name is an ID to the vendors table. The > > autocomplete was returning the ID, not the name. Sure it seemed easy > > to implement, but it also seemed to be limited. I couldn't figure out > > how to get the vendor name instead of the ID. > > Right, so from your Supplier model, you can do > $this->Vendor->find(...). From your SuppliersController, > $this->Supplier->Vendor->find(...) > > > So I beg of the community, can someone put up an up-to-date, step-by- > > step tutorial on how to properly implement AJAX autocomplete?? > > You needn't rely on a Cake helper to do this. The js side of it is > just handling the change event on your select list by sending an ajax > request to the server. There are several jQuery plugins built just for > this. The Cake side of it is simply receiving a string and doing a > find('list') with an, eg. "LIKE ${str}%" condition (be sure to check > that input) and sending back a list of results. Use RequestHandler and > create an ajax.ctp layout, then echo json_encode($res). -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Another AJAX Autocomplete question
On Sat, Apr 23, 2011 at 3:25 PM, turbo2ltr wrote: > I see there are a lot of questions about implementing AJAX > autocomplete, but I'll be dammed if every single thing on the subject > is woefully confusing or from the mid 2000s. > > I go to the 1.3 cookbook under Ajax and right at the top is says > AjaxHelper is depreciated, then it goes on to talk about those same > things. How can the latest version of cakePHP already be depreciated? It's not the latest version that's deprecated, a portion of it. Pretty normal for any software project. http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3 > I've tried about 8 different implementations of ajax autocomplete that > I've found on the web and could not get any of them to work...mostly > because they assumed I'm smarter than I am (not step by step > instructions, but code snippets or pseudo code), or they were written > for an out of date version of cake. > > Prototype? Scriptalicious? JQuery? WTF are we supposed to use? Pick your poison. http://book.cakephp.org/view/1596/Javascript-engine-usage#!/view/1594/Using-a-specific-Javascript-engine I recommend jQuery. > Actually I did get this one to sorta work, sorta: > http://cakebaker.42dh.com/2006/06/06/autocompletion-the-easy-way/ As you alluded to in the beginning, that's much to old to serve as anything but a hint. Cake has changed a lot. > The field I want to autocomplete is a vendor name. But in the the > suppliers model, the vendor name is an ID to the vendors table. The > autocomplete was returning the ID, not the name. Sure it seemed easy > to implement, but it also seemed to be limited. I couldn't figure out > how to get the vendor name instead of the ID. Right, so from your Supplier model, you can do $this->Vendor->find(...). From your SuppliersController, $this->Supplier->Vendor->find(...) > So I beg of the community, can someone put up an up-to-date, step-by- > step tutorial on how to properly implement AJAX autocomplete?? You needn't rely on a Cake helper to do this. The js side of it is just handling the change event on your select list by sending an ajax request to the server. There are several jQuery plugins built just for this. The Cake side of it is simply receiving a string and doing a find('list') with an, eg. "LIKE ${str}%" condition (be sure to check that input) and sending back a list of results. Use RequestHandler and create an ajax.ctp layout, then echo json_encode($res). -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Another AJAX Autocomplete question
I see there are a lot of questions about implementing AJAX autocomplete, but I'll be dammed if every single thing on the subject is woefully confusing or from the mid 2000s. I go to the 1.3 cookbook under Ajax and right at the top is says AjaxHelper is depreciated, then it goes on to talk about those same things. How can the latest version of cakePHP already be depreciated? I've tried about 8 different implementations of ajax autocomplete that I've found on the web and could not get any of them to work...mostly because they assumed I'm smarter than I am (not step by step instructions, but code snippets or pseudo code), or they were written for an out of date version of cake. Prototype? Scriptalicious? JQuery? WTF are we supposed to use? Actually I did get this one to sorta work, sorta: http://cakebaker.42dh.com/2006/06/06/autocompletion-the-easy-way/ The field I want to autocomplete is a vendor name. But in the the suppliers model, the vendor name is an ID to the vendors table. The autocomplete was returning the ID, not the name. Sure it seemed easy to implement, but it also seemed to be limited. I couldn't figure out how to get the vendor name instead of the ID. So I beg of the community, can someone put up an up-to-date, step-by- step tutorial on how to properly implement AJAX autocomplete?? Pulleeez? TIA -Mike -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Implement AJAX Autocomplete
Actually it is really simple. You need to have the jQueryUI autocomplete library in your applications js folder (webroot/js), without that, it won't work. In the view you only need a few lines of code like: $this->Js->buffer( '$("ID_OF_THE_AUTOCOMPLETE_INPUT").autocomplete({ source: "/CONTROLLER/AUTOCOMPLETE_ACTION", }); ); Implement an action that does fetch the data for autocomplete in your controller do: 1. check that the request isAjax() 2. fetch the data your want in your autocomplete field. 3. set the data for the view (in my case I made an extra view since the jQuery-Autocompleter expects JSON-encoded data. 4. in the view, do an $this->Js->object(DATA_TO_ENCODE); so the data is as expected. That's it. On 11 Apr., 05:21, tubiz wrote: > Please I have been trying to implement the AJAX autocomplete found in > the Cakephp 1.3 cookbook but I havent gotten it to work. > > There is a artist table in my database and I would like to implement > autocomplete for a field in the Submit action in the Lyrics controller > > The autocomplete will be getting the name of artist in the artist > controller and displaying it in a text field in the Lyrics controller. > > Would like to know how to do this and would the autocomplete action be > in the artist controller or in the lyrics controller. > > Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Implement AJAX Autocomplete
Please I have been trying to implement the AJAX autocomplete found in the Cakephp 1.3 cookbook but I havent gotten it to work. There is a artist table in my database and I would like to implement autocomplete for a field in the Submit action in the Lyrics controller The autocomplete will be getting the name of artist in the artist controller and displaying it in a text field in the Lyrics controller. Would like to know how to do this and would the autocomplete action be in the artist controller or in the lyrics controller. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
extends autoComplete - Need ID of chosen element and set it inside hidden field
I followed http://book.cakephp.org/view/632/autoComplete, and this work. Now the problem is: I choose an element from suggested items, but actually I haven't ID so this isn't so usefull. It could be better if as soon I choose an element, it's id will be stored immediatly inside an hidden input, so I could send it to the form's action with proper info. How can I do that? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
[Ask] ModalBox vs AutoComplete. Conflict or something?
Hello,, I'm having problem using modalBox. I have a work autocomplete in add user script. But when i combined it using modalbox, it doesn't work. If I access it normally, it worked. Can someone help? ## autocomplete() ## function autoComplete(){ $this->set('groups', $this->User->Group->find('all', array( 'conditions' => array( 'Group.name LIKE' => $this->data['Group']['name'].'%' ), 'fields' => array('name', 'id') ))); //$this->layout = 'ajax'; } ## add.ctp ## "; if ($ajax->isAjax()) { echo $ajax->form('edit', 'post', array( 'model'=> 'User', 'url' => array('controller' => 'users', 'action' => 'add'), 'update' => 'MB_content', 'complete' => 'closeModalbox()' )); }else{ echo $this->Form->create('User'); } ?> Form->input('username'); echo $this->Form->input('password'); echo __('Group'); echo $ajax->autoComplete('Group.name', '/users/autoComplete', array('frequency' => '0.6', 'afterUpdateElement' => 'setValuesId')); echo $this->Form->input('group_id', array('type' => 'hidden')); ?> Form->end('Submit', array('class' => 'MB_focusable')); ?> My reference of doing this is http://nerdnotes.org/2008/02/combining-modalbox-cakephp/. -- Regards,,, mastanto http://www.mastanto.com http://thom-sharing.blogspot.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
So Nic, you got it to work? I didn't have to change the $_callbackArguments field; I just modified the callback arguments within my implementation of autocomplete(). -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
Sent from my iPhone On Feb 21, 2011, at 1:42 AM, "Nic [via CakePHP]" < ml-node+3393716-227172156-150...@n5.nabble.com> wrote: You will also need to add this as part of the $_callbackArguments : 'autocomplete' => array( 'search' => 'event, ui', 'open' => 'event, ui', 'focus' => 'event, ui', 'select' => 'event, ui', 'close' => 'event, ui', 'change' => 'event, ui', ), ------ If you reply to this email, your message will be added to the discussion below: http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocomplete-Missing-method-tp3270384p3393716.html To unsubscribe from CakePHP 1.3, JSHelper and Autocomplete, Missing method?, click here<http://cakephp.1045679.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3270384&code=Y3J1c3R5c25haWxAZ21haWwuY29tfDMyNzAzODR8LTE3NjQwNDM2OTI=>. -- View this message in context: http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocomplete-Missing-method-tp3270384p3393732.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
You will also need to add this as part of the $_callbackArguments : 'autocomplete' => array( 'search' => 'event, ui', 'open' => 'event, ui', 'focus' => 'event, ui', 'select' => 'event, ui', 'close' => 'event, ui', 'change' => 'event, ui', ), -- View this message in context: http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocomplete-Missing-method-tp3270384p3393716.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
How did you get autocomplete to work with jQuery? I can only find it separate with jQuery UI and nothing as to how they work together ... or am I missing something and way off from the start here? -- View this message in context: http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocomplete-Missing-method-tp3270384p3393619.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
$ajax->autoComplete
Hello everyone, this issue ... I have an autocomplete text field that displays the field "codice" but i would assign the value "cod_mezzi". I state that the table does not use conventional names. These lines that I wrote. model mean.php array( 'className' => 'Reservation', 'foreignKey' => 'mean_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ) ); } ?> model reservation.php array( 'className' => 'Place', 'foreignKey' => 'place_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Mean' => array( 'className' => 'Mean', 'foreignKey' => 'mean_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); } ?> means_controller.php Mean->find('all', array( 'conditions' => array( 'Mean.codice LIKE' => '%' . $this->data['Mean']['codice'].'%' ), 'fields' => array('cod_mezzi','codice'))); $this->set(compact('means')); if(isset($this->params['requested'])) { return $means; } $this->set('means', $means); $this->layout = 'ajax'; } ... ... ?> reservations_controller.php data)) { $this->Reservation->create(); if ($this->Reservation->save($this->data)) { $this->Session->setFlash(__('The Reservation has been saved', true)); $this->redirect(array('action'=>'index')); } else { $this->Session->setFlash(__('The Reservation could not be saved. Please, try again.', true)); } } $places = $this->Reservation->Place->find('list'); $means = $this->Reservation->Mean->find('list'); $this->set(compact('places', 'means')); } .. .. ?> view reservation add.ctp create('Reservation');?> input('place_id'); echo $form->input('from'); echo $form->input('to'); // this show the field "codice", it's ok ... how can I assign the value cod_mezzi ??? echo $ajax->autoComplete('codice', '/means/autoComplete'); ?> end('Submit');?> thanks for the help. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: official way to create autoComplete field
Hi, I detail how I achieve it in this post: http://groups.google.com/group/cake-php/browse_thread/thread/d1bbbf7be0a93a30#. Unfortunately I am still having a few problems with the rendering. Please let me know if you find a solution. Cheers, ojonam On Jan 7, 9:40 am, Stephen wrote: > Unfortunately autoComplete doesn't come out of the box for the jsHelper in > 1.3 > > This old thread may help > you:http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocom... > > On 6 January 2011 18:03, rethab wrote: > > > > > Hey guys > > > With version 1.3, the AJAX and JavaScript Helper have become > > deprecated. Since there is no autoComplete method in Js nor in HTML > > Helper, what is the official way to make such a field? > > > Do I have to make it on my own? > > > Any advice is appreciated! > > > - RetHab > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > -- > Kind Regards > Stephen @ NinjaCoderMonkey > > www.ninjacodermonkey.co.uk 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
Re: official way to create autoComplete field
Unfortunately autoComplete doesn't come out of the box for the jsHelper in 1.3 This old thread may help you: http://cakephp.1045679.n5.nabble.com/CakePHP-1-3-JSHelper-and-Autocomplete-Missing-method-td3270384.html On 6 January 2011 18:03, rethab wrote: > Hey guys > > With version 1.3, the AJAX and JavaScript Helper have become > deprecated. Since there is no autoComplete method in Js nor in HTML > Helper, what is the official way to make such a field? > > Do I have to make it on my own? > > Any advice is appreciated! > > - RetHab > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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
official way to create autoComplete field
Hey guys With version 1.3, the AJAX and JavaScript Helper have become deprecated. Since there is no autoComplete method in Js nor in HTML Helper, what is the official way to make such a field? Do I have to make it on my own? Any advice is appreciated! - RetHab 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
ajax autocomplete method
Hi All, I'm making a search form for our document library at work. Document HABTM keyword. In the search form I'd like an autocomplete AJAX input field to find a registered keyword. I followed this tutorial: http://mrphp.com.au/code/search-forms-cakephp but it doesn't seem to work (when I starttyping words into the input field there'sno auto-completion). In my case the keywords are in a separate table, and coupled by a HABTM assoiation, maybe that's the problem? In which controller do I put the autoComplete() method? In the documents_controller or the keywords_controller? Best regards G 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
Ajax Helper autoComplete
I have been using CakePHP for a short while but, recently tried to use autoComplete for one of my displays. During my testing I felt it necessary to include an option array for 'after' to call a javascript of mine. While the code does not break the page display or any of the CakePHP functionality, it also does not call my javascript as is explained in the Version 1.3 documentation. The call provides for 3 parameters to be passed with the third one being an options array. By changing the option chosen by me to many of the other options I still am unable to have my script called. Any suggestions? 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
I ran into this issue a while ago. I decided to add the autocomplete method to the JsHelper / jQuery engine myself. Here's what you need to do. In jquery_engine.php, you need to create an autocomplete method. You can copy/paste from a similar method e.g. the 'sortable' method. You might want to make some modifications regarding the callback functions that you pass in the options argument. This is what I had in the end: /** * Create an autocomplete element. * * @param array $options Array of options for the autocomplete. * @return string Completed autocomplete script. * @access public * @see JsBaseEngineHelper::autocomplete() for options list. */ function autocomplete($options = array()) { $template = '%s.autocomplete({%s});'; // don't escape the 'select' or 'search' functions $callbacks = array('select', 'search'); return $this->_methodTemplate('autocomplete', $template, $options, $callbacks); } Note that if you want to use Autocomplete's custom rendering (http:// jqueryui.com/demos/autocomplete/#custom-data), you'll have to change the template above and allow for additional arguments that specify the rendering function. If you want to make the rendered JS for the autocomplete appear in the JS buffer, you need to add your 'autocomplete' method to the list of bufferedMethods in the JsBaseEngineHelper class (js.php). That should be it! You can then use your autocomplete in your view like this: $this->Js->get('#employee_autocomplete')->autocomplete( array( 'source' => $this->Html- >url(array('controller'=>'employees', 'action'=>'get_employee_names')), 'minLength' => 3, 'search' => 'function (event, ui) { ... }', 'select' => 'function (event, ui) { ... }')); One last hint - FireBug (or similar network debugging tool) is your friend when trying to figure out why your AJAX posts don't return any results. You can check the "Response" tab for Cake/PHP generated errors. Hope this helps! On Nov 19, 7:06 am, nurvzy wrote: > That cookbook link you reference is for the Ajax Helper, not the > JsHelper. To my knowledge autocomplete is not supported out of the > box using the JsHelper. But it's simple enough to do on your own. > > http://docs.jquery.com/UI/Autocomplete > > Nick > > On Nov 18, 1:09 am, Louie Miranda wrote: > > > > > > > > > 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:* > > autoComplete('q', '/publications/autocompletetitle', > > array('minChars' => 4, 'class' => 'search')); ?> > > > *Was switched to the following:* > > 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
Re: CakePHP 1.3, JSHelper and Autocomplete, Missing method?
That cookbook link you reference is for the Ajax Helper, not the JsHelper. To my knowledge autocomplete is not supported out of the box using the JsHelper. But it's simple enough to do on your own. http://docs.jquery.com/UI/Autocomplete Nick On Nov 18, 1:09 am, Louie Miranda wrote: > 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:* > autoComplete('q', '/publications/autocompletetitle', > array('minChars' => 4, 'class' => 'search')); ?> > > *Was switched to the following:* > 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
CakePHP 1.3, JSHelper and Autocomplete, Missing method?
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:* autoComplete('q', '/publications/autocompletetitle', array('minChars' => 4, 'class' => 'search')); ?> *Was switched to the following:* 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
Re: Autocomplete with Ajax doesn't work in Chrome/Chromium
I have to say something additional: It is right that it doesn't work in Chromium at all, but i have a strange problem in Firefox and Opera too: When i start a browser it is necessary that i first of all use an ajax autocomplete of another view (ViewB) to make it work in my current view (ViewA). It nearly looks like i have to "activate" first the autocomplete of ViewA with the one of ViewB and this i cannot explain at all. Do you? The difference between this two views is just that in ViewB i use a $this->Form->select and in ViewA a $this->Form->input... type='select'... Thanks a lot for bringing any light in my darkness :) On 5 Sep., 20:35, DerBjörn wrote: > Hi, > > I want to use an autocomplete of states and cities with Ajax in a > form. It works perfectly in Firefox and Opera, but not in Chromium. > Which can be the reasons or how/what i have to check to get an idea of > its malfunction?!? > What i already checked is the fact that JavaScript is activated. > > Thanks a lot :) > > --- CODE > echo $this->Form->input('country_id' , array('id' => 'countries', > 'type' => 'select', 'label' => 'Please select a country', 'options' => > array('' => '-',$countries))); > echo $this->Form->input('state_id' , array('id' => 'states', 'type' => > 'select', 'label' => 'Please select a state', 'options' => array('' => > '-',$states))); > echo $this->Form->input('city_id' , array('id' => 'cities', 'type' => > 'select', 'label' => 'Please select a city', 'options' => array('' => > '-',$cities))); > > echo $javascript->link('/js/scriptaculous183/lib/prototype'); > echo $javascript->link('/js/scriptaculous183/src/scriptaculous'); > ... > echo $ajax- > > >observeField('countries',array('url'=>'update_state_select','update'=>'states')); > echo $ajax- > >observeField('states',array('url'=>'update_city_select','update'=>'cities')); 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
Autocomplete with Ajax doesn't work in Chrome/Chromium
Hi, I want to use an autocomplete of states and cities with Ajax in a form. It works perfectly in Firefox and Opera, but not in Chromium. Which can be the reasons or how/what i have to check to get an idea of its malfunction?!? What i already checked is the fact that JavaScript is activated. Thanks a lot :) --- CODE echo $this->Form->input('country_id' , array('id' => 'countries', 'type' => 'select', 'label' => 'Please select a country', 'options' => array('' => '-',$countries))); echo $this->Form->input('state_id' , array('id' => 'states', 'type' => 'select', 'label' => 'Please select a state', 'options' => array('' => '-',$states))); echo $this->Form->input('city_id' , array('id' => 'cities', 'type' => 'select', 'label' => 'Please select a city', 'options' => array('' => '-',$cities))); echo $javascript->link('/js/scriptaculous183/lib/prototype'); echo $javascript->link('/js/scriptaculous183/src/scriptaculous'); ... echo $ajax- >observeField('countries',array('url'=>'update_state_select','update'=>'states')); echo $ajax- >observeField('states',array('url'=>'update_city_select','update'=>'cities')); 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
Re: Autocomplete
On Aug 23, 2010, at 3:39 PM, Philip Thompson wrote: > Hi all. > > I'm using MooTools 1.2.4 and CakePHP 1.3. I'm attempting to get > Autocompleter.Ajax.Json() working, but I'm not seeing the result list. > Firebug is letting me know that the query is returning the correct results, > but still not seeing anything. From the Cake side of things, am I approaching > this the correct way? > > // /app/controllers/hardwares_controller.php > class HardwaresController extends AppController { >public function config () { >$options = array( >'conditions' => array( >'ConfigurationType.name LIKE' => '%'.$_POST['q'].'%', >), >); >$configType = $this->import('ConfigurationType', 'Model'); >$types = $configType->find('list', $options); >$this->set('output', json_encode ($types)); >$this->render('/elements/ajax'); >} > } > > // /app/views/elements/ajax.ctp > if (isset ($output)) { >echo $output; > } > ?> > > > new Autocompleter.Ajax.Json(document.id(input), url, { >postVar: 'q', >postData: {}, >ajaxOptions: {}, >minLength: 1, >delay: 100, >filterSubset: true, >filterCase: false, >relative: false, >selectedMode: true, >zIndex: 1, >evalScripts: true, >selectFirst: true > }); > > > Again, the result is being returned, but the javascript seems to not be > picking up on it. Not sure if it's how I'm rendering the result or what? Any > thoughts would be appreciated! > > http://clientcide.com/docs/3rdParty/Autocompleter.Remote > http://www.clientcide.com/wiki/cnet-libraries/11-3rdparty/03-autocompleter.remote > > Thanks in advance, > ~Philip > > http://lonestarlightandsound.com/ Figured out what the issue was. The autocomplete was working properly, however, the CSS was preventing the list from being shown in the correct spot (not below the input box). To fix it, I gave the surrounding div and ul a position of relative. div.config div, div.config ul { position: relative; } Thanks. ~Philip http://lonestarlightandsound.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
Autocomplete
Hi all. I'm using MooTools 1.2.4 and CakePHP 1.3. I'm attempting to get Autocompleter.Ajax.Json() working, but I'm not seeing the result list. Firebug is letting me know that the query is returning the correct results, but still not seeing anything. From the Cake side of things, am I approaching this the correct way? array( 'ConfigurationType.name LIKE' => '%'.$_POST['q'].'%', ), ); $configType = $this->import('ConfigurationType', 'Model'); $types = $configType->find('list', $options); $this->set('output', json_encode ($types)); $this->render('/elements/ajax'); } } // /app/views/elements/ajax.ctp if (isset ($output)) { echo $output; } ?> new Autocompleter.Ajax.Json(document.id(input), url, { postVar: 'q', postData: {}, ajaxOptions: {}, minLength: 1, delay: 100, filterSubset: true, filterCase: false, relative: false, selectedMode: true, zIndex: 1, evalScripts: true, selectFirst: true }); Again, the result is being returned, but the javascript seems to not be picking up on it. Not sure if it's how I'm rendering the result or what? Any thoughts would be appreciated! http://clientcide.com/docs/3rdParty/Autocompleter.Remote http://www.clientcide.com/wiki/cnet-libraries/11-3rdparty/03-autocompleter.remote Thanks in advance, ~Philip http://lonestarlightandsound.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
Re: Autocomplete result not shown
Hi! I've found the issue. Javascripts weren't loaded at the right time. I changed in my view the lines echo $javascript->link('scriptaculous-1.8.3/lib/prototype'); echo $javascript->link('scriptaculous-1.8.3/src/scriptaculous'); into $this->addScript("prototype", $javascript->link('scriptaculous-1.8.3/ lib/prototype')); $this->addScript("scriptaculous", $javascript- >link('scriptaculous-1.8.3/src/scriptaculous')); Now they're loaded earlier and the everything is ok. reets Oliver On 16 Aug., 15:51, Kasimir wrote: > Hi group! > > After reading many pages and this group I'm not able to find my bug, > why my result of the autocomplete-request is not shown on my page. > > Here's what I have so far: > > controller: > -- > class RadacctsController extends AppController { > var $name = 'Radaccts'; > var $helpers = array('Html', 'Form', ''Ajax', 'Number', 'Time'); > var $uses = array('Radacct', 'Radcheck'); > > function autoComplete(){ > $this->set('results', $this->Radcheck->find('all', array( > 'conditions' => array( > 'Radcheck.UserName LIKE' => $this->data['Radacct'] > ['Username'].'%', > ), > 'limit' => '15', > 'fields' => array('username') > ))); > $this->layout = 'ajax'; > } > > my view "index.ctp" > > > > echo $javascript->link('scriptaculous-1.8.3/lib/prototype'); > echo $javascript->link('scriptaculous-1.8.3/src/scriptaculous'); > > echo $ajax->form(array( > 'type' => 'post', > 'options' => array( > 'update'=>'login_liste', > 'url' => array( > 'controller' => 'radaccts', > 'action' => 'autoComplete' > ) > ) > ) > ); > echo $ajax->autoComplete('Radacct.Username', '/radaccts/ > autoComplete'); > echo $form->end('Show logins'); > > echo $ajax->div('login_liste'); > ?> > > > and my view auto_complete.ctp > - > params); ?> > > > > > > > What is strange is, I have to press the "submit"-button to get the > request sent. In the wireshark-trace I see the request and afterwards > the result "my results. > > So were is the but to have shown my results under the input-field? > > Thanks for your help > Oliver 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
Autocomplete result not shown
Hi group! After reading many pages and this group I'm not able to find my bug, why my result of the autocomplete-request is not shown on my page. Here's what I have so far: controller: -- class RadacctsController extends AppController { var $name = 'Radaccts'; var $helpers = array('Html', 'Form', ''Ajax', 'Number', 'Time'); var $uses = array('Radacct', 'Radcheck'); function autoComplete(){ $this->set('results', $this->Radcheck->find('all', array( 'conditions' => array( 'Radcheck.UserName LIKE' => $this->data['Radacct'] ['Username'].'%', ), 'limit' => '15', 'fields' => array('username') ))); $this->layout = 'ajax'; } my view "index.ctp" link('scriptaculous-1.8.3/lib/prototype'); echo $javascript->link('scriptaculous-1.8.3/src/scriptaculous'); echo $ajax->form(array( 'type' => 'post', 'options' => array( 'update'=>'login_liste', 'url' => array( 'controller' => 'radaccts', 'action' => 'autoComplete' ) ) ) ); echo $ajax->autoComplete('Radacct.Username', '/radaccts/ autoComplete'); echo $form->end('Show logins'); echo $ajax->div('login_liste'); ?> and my view auto_complete.ctp - params); ?> What is strange is, I have to press the "submit"-button to get the request sent. In the wireshark-trace I see the request and afterwards the result "my results. So were is the but to have shown my results under the input-field? Thanks for your help Oliver 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
Re: Autocomplete, can't find $this->data?
One note (for future readers too) - you are forcing your form element to GET - only POST data is populated into $this->data. On Aug 3, 8:11 pm, Louie Miranda wrote: > *Solved it!* > > I can't seem to debug($this->data), so I debug($this->params); > > And found the solution. > > $this->params['form']['q']; > > Instead of > > $this->data['q'] > > Which is not working. > > Regards, > -- > Louie Miranda > - Email: lmira...@gmail.com > - Web:http://www.louiemiranda.com > > On Wed, Aug 4, 2010 at 11:04 AM, Louie Miranda wrote: > > I tried the ajax autocomplete manual. > >http://book.cakephp.org/it/view/1370/autoComplete > > > *PROBLEM:* > > > 1. I can't seem to query $this->data['q']; > > 2. Therefore, the auto complete list shows, everything. And not the > > specific keyword or "q" value. > > > How will I query $this->data['q'];? I think, I followed everything. What > > seems to be wrong? > > > The codes: > > > *Added my controller* > > > function autocompletetitle() { > >> $this->set('results', $this->Publication->find('all', array( > >> 'conditions' => array( > >> 'Publication.itemName LIKE' => $this->data['q'].'%' > >> ), > >> 'fields' => array('itemName') > >> ))); > >> $this->layout = 'ajax'; > >> } > > > *And my form* > > > create('Publication', array('action' => 'sresults', > >> 'type' => 'get'));?> > >> autoComplete('q', '/publications/autocompletetitle'); ?> > >> end('Search'); ?> > > > The autocompletetitle view is set and working, I can see it when accessing > > /autocompletetitle and if I search. > > > -- > > 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
Re: Autocomplete, can't find $this->data?
*Solved it!* I can't seem to debug($this->data), so I debug($this->params); And found the solution. $this->params['form']['q']; Instead of $this->data['q'] Which is not working. Regards, -- Louie Miranda - Email: lmira...@gmail.com - Web: http://www.louiemiranda.com On Wed, Aug 4, 2010 at 11:04 AM, Louie Miranda wrote: > I tried the ajax autocomplete manual. > http://book.cakephp.org/it/view/1370/autoComplete > > *PROBLEM:* > >1. I can't seem to query $this->data['q']; >2. Therefore, the auto complete list shows, everything. And not the >specific keyword or "q" value. > > How will I query $this->data['q'];? I think, I followed everything. What > seems to be wrong? > > The codes: > > *Added my controller* > > function autocompletetitle() { >> $this->set('results', $this->Publication->find('all', array( >> 'conditions' => array( >> 'Publication.itemName LIKE' => $this->data['q'].'%' >> ), >> 'fields' => array('itemName') >> ))); >> $this->layout = 'ajax'; >> } >> > > > *And my form* > > create('Publication', array('action' => 'sresults', >> 'type' => 'get'));?> >> autoComplete('q', '/publications/autocompletetitle'); ?> >> end('Search'); ?> >> > > The autocompletetitle view is set and working, I can see it when accessing > /autocompletetitle and if I search. > > -- > 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
Autocomplete, can't find $this->data?
I tried the ajax autocomplete manual. http://book.cakephp.org/it/view/1370/autoComplete *PROBLEM:* 1. I can't seem to query $this->data['q']; 2. Therefore, the auto complete list shows, everything. And not the specific keyword or "q" value. How will I query $this->data['q'];? I think, I followed everything. What seems to be wrong? The codes: *Added my controller* function autocompletetitle() { > $this->set('results', $this->Publication->find('all', array( > 'conditions' => array( > 'Publication.itemName LIKE' => $this->data['q'].'%' > ), > 'fields' => array('itemName') > ))); > $this->layout = 'ajax'; > } > *And my form* create('Publication', array('action' => 'sresults', 'type' > => 'get'));?> > autoComplete('q', '/publications/autocompletetitle'); ?> > end('Search'); ?> > The autocompletetitle view is set and working, I can see it when accessing /autocompletetitle and if I search. -- 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
Autocomplete Help
I need a help in Autocomplete in cakephp. My controller: class AmaladdsController extends AppController { var $name = 'Amaladds'; var $helpers = array('Html', 'Form', 'Javascript', 'Ajax', 'Layout'); .. ... . function autoComplete() { //Partial strings will come from the autocomplete field as //$this->data['Amaladd']['subject'] $this->set('posts', $this->Amaladd->find('all', array( 'conditions' => array( 'Amaladd.subject LIKE' => $this->data['Amaladd']['place'].'%' ), 'fields' => array('place') ))); $this->layout = 'ajax'; } My view (auto_complete.ctp) My form: create('User', array('url' => '/users/index')); ?> autoComplete('Amaladd.subject', '/amaladds/ autoComplete')?> end('View Post')?> in my layout file i included: print $javascript->link('prototype'); print $javascript->link('scriptaculous'); print $javascript->link('scriptaculous/src/effects'); print $javascript->link('scriptaculous/src/controls'); Everything is similar to the Manual. But It doesnot work. In the generated script in Firebug it show this line after submitting the form: //<![CDATA[ new Ajax.Autocompleter('AmaladdPlace', 'AmaladdPlace_autoComplete', '/ amaladds/index', {}); //]]> What is wrong here??? when I type first 3 or more letters of the 'Place' field in my database, nothing happens. Please help me 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
Re: Autocomplete is not working
On Jun 10, 3:20 am, Vijay wrote: > Hello All, > > I am using the cakephp ajax autocomplete, but it is not giving me any > response back. > > I tried with the other ajax methods like observerfield it is working > fine. But when i try with the autocomplete it calls the function but > returns with blank response. I am using prototype & jquery in this > application. I applied jquery no-conflict for all the methods that are > related with the jquery. I recommend you use one or the other. Otherwise, you're loading a lot of overlapping functionality. > Can anybody give me an idea why this is happening. I read some where > that autocomplete will not work if we are using both jquery & > prototype together.So i tried by removing all the jquery files & > functions i used, but no luck. > > It is still giving me error. Also the error is "element is undefined > in controls.js line no. 175" This is a javascript problem. Install FireBug in Firefox to debug. You'll need to know, first off, if there's even a request being sent to the server. (ie. Is the error being thrown before anything is sent or after the response comes back?) 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
Re: Autocomplete is not working
Please provide more information! 1) Provide the code for the controller method that will deliver the data. 2) Provide the code for the view that will return the delivered data. 3) Provide the code for the view in which the autocomplete is required. Enjoy, John On Jun 10, 10:20 am, Vijay wrote: > Hello All, > > I am using the cakephp ajax autocomplete, but it is not giving me any > response back. > > I tried with the other ajax methods like observerfield it is working > fine. But when i try with the autocomplete it calls the function but > returns with blank response. I am using prototype & jquery in this > application. I applied jquery no-conflict for all the methods that are > related with the jquery. > > Can anybody give me an idea why this is happening. I read some where > that autocomplete will not work if we are using both jquery & > prototype together.So i tried by removing all the jquery files & > functions i used, but no luck. > > It is still giving me error. Also the error is "element is undefined > in controls.js line no. 175" 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