PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > New Ajax search component
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
New Ajax search component

Réponse
 
LinkBack Outils de la discussion
Vieux 08/04/2008, 15h41   #1
Jeremy O'Connor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut New Ajax search component

Hi

I have written a new component that can be included in your form, and allows
the user to search a data source by entering the search term(s) and using
Ajax to return a list of results in a dropdown control, from which the user
can select the desired item. It uses the prototype JavaScript library, which
you need to get from their website. You can view a demo and download the
source at: http://jeremywebdeveloper.co.za/code/ajaxsearch/

--
Jeremy O'Connor


  Réponse avec citation
Vieux 08/04/2008, 16h42   #2
Jay Blanchard
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: [PHP] New Ajax search component

[snip]
I have written a new component that can be included in your form, and
allows
the user to search a data source by entering the search term(s) and
using
Ajax to return a list of results in a dropdown control, from which the
user
can select the desired item. It uses the prototype JavaScript library,
which
you need to get from their website. You can view a demo and download the

source at: http://jeremywebdeveloper.co.za/code/ajaxsearch/
[/snip]

Cool...I'd have the 'submit' button hidden until results were returned
so as to avoid user confusion.
  Réponse avec citation
Vieux 08/04/2008, 18h15   #3
Jeremy O'Connor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

""Jay Blanchard"" <jblanchard@pocket.com> wrote in message
news:9F6B7518E92167499E0168D01C2D8D9C39101E@YGEX01 WAL.onecall.local...

> Cool...I'd have the 'submit' button hidden until results were returned
> so as to avoid user confusion.


Yes, something to add in a later version of the component.

--
Jeremy O'Connor


  Réponse avec citation
Vieux 08/04/2008, 18h37   #4
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor <joconnor@netactive.co.za>
wrote:

> Hi
>
> I have written a new component that can be included in your form, and
> allows
> the user to search a data source by entering the search term(s) and using
> Ajax to return a list of results in a dropdown control, from which the
> user
> can select the desired item. It uses the prototype JavaScript library,
> which
> you need to get from their website. You can view a demo and download the
> source at: http://jeremywebdeveloper.co.za/code/ajaxsearch/



they pretty much have that in the scriptacuous lib under Ajax.Autocompleter,
atm

http://wiki.script.aculo.us/scriptac....Autocompleter
http://demo.script.aculo.us/ajax/autocompleter
http://demo.script.aculo.us/ajax/aut...ter_customized

plus they have a client side version as well to mitigate bandwidth
consumption for small data sets.

http://wiki.script.aculo.us/scriptac...ompleter.Local

-nathan

  Réponse avec citation
Vieux 08/04/2008, 18h50   #5
Eric Butera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 12:37 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
> they pretty much have that in the scriptacuous lib under Ajax.Autocompleter,
> atm
>
> http://wiki.script.aculo.us/scriptac....Autocompleter
> http://demo.script.aculo.us/ajax/autocompleter
> http://demo.script.aculo.us/ajax/aut...ter_customized
>
> plus they have a client side version as well to mitigate bandwidth
> consumption for small data sets.
>
> http://wiki.script.aculo.us/scriptac...ompleter.Local
>
> -nathan
>



As long as we're raining on parades

http://developer.yahoo.com/yui/autocomplete/
  Réponse avec citation
Vieux 08/04/2008, 20h10   #6
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 10:50 AM, Eric Butera <eric.butera@gmail.com> wrote:

> On Tue, Apr 8, 2008 at 12:37 PM, Nathan Nobbe <quickshiftin@gmail.com>
> wrote:
> > they pretty much have that in the scriptacuous lib under

> Ajax.Autocompleter,
> > atm
> >
> > http://wiki.script.aculo.us/scriptac....Autocompleter
> > http://demo.script.aculo.us/ajax/autocompleter
> > http://demo.script.aculo.us/ajax/aut...ter_customized
> >
> > plus they have a client side version as well to mitigate bandwidth
> > consumption for small data sets.
> >
> > http://wiki.script.aculo.us/scriptac...ompleter.Local
> >
> > -nathan
> >

>
>
> As long as we're raining on parades
>
> http://developer.yahoo.com/yui/autocomplete/



lol! ya, havent finished parsing through this one; but a good read on the
topic

http://extjs.com/forum/showthread.php?t=551

btw; planning on digging into extJs once i get a chance to take a piss :O

-nathan

  Réponse avec citation
Vieux 08/04/2008, 20h32   #7
Eric Butera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 2:10 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
> btw; planning on digging into extJs once i get a chance to take a piss :O


I've heard a lot of good things about that. Let me know what you
think, after you piss of course. =)
  Réponse avec citation
Vieux 08/04/2008, 23h53   #8
tedd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

>As long as we're raining on parades
>
>http://developer.yahoo.com/yui/autocomplete/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


And to continue:

http://www.webbytedd.com/c/ajax-pop-down/


Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
  Réponse avec citation
Vieux 09/04/2008, 00h17   #9
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 3:53 PM, tedd <tedd.sperling@gmail.com> wrote:

> As long as we're raining on parades
> >
> > http://developer.yahoo.com/yui/autocomplete/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

>
> And to continue:
>
> http://www.webbytedd.com/c/ajax-pop-down/



thats the idea

-nathan

  Réponse avec citation
Vieux 09/04/2008, 01h12   #10
tedd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

At 4:17 PM -0600 4/8/08, Nathan Nobbe wrote:
>On Tue, Apr 8, 2008 at 3:53 PM, tedd
><<mailto:tedd.sperling@gmail.com>tedd.sperling@gm ail.com> wrote:
>
>As long as we're raining on parades
>
><http://developer.yahoo.com/yui/autocomplete/>http://developer.yahoo.com/yui/autocomplete/
>
>--
>
>PHP General Mailing List (<http://www.php.net/>http://www.php.net/)
>To unsubscribe, visit:
><http://www.php.net/unsub.php>http://www.php.net/unsub.php
>
>
>And to continue:
>
><http://www.webbytedd.com/c/ajax-pop-down/>http://www.webbytedd.com/c/ajax-pop-down/
>
>
>thats the idea
>
>-nathan


There are no new ideas, just different spins to old ones.

Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
  Réponse avec citation
Vieux 09/04/2008, 01h28   #11
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Tue, Apr 8, 2008 at 5:12 PM, tedd <tedd.sperling@gmail.com> wrote:

> At 4:17 PM -0600 4/8/08, Nathan Nobbe wrote:
>
> > On Tue, Apr 8, 2008 at 3:53 PM, tedd <<mailto:tedd.sperling@gmail.com>
> > tedd.sperling@gmail.com> wrote:
> >
> > As long as we're raining on parades
> >
> > <http://developer.yahoo.com/yui/autocomplete/>
> > http://developer.yahoo.com/yui/autocomplete/
> >
> > --
> >
> > PHP General Mailing List (<http://www.php.net/>http://www.php.net/)
> > To unsubscribe, visit: <http://www.php.net/unsub.php>
> > http://www.php.net/unsub.php
> >
> >
> > And to continue:
> >
> > <http://www.webbytedd.com/c/ajax-pop-down/>
> > http://www.webbytedd.com/c/ajax-pop-down/
> >
> >
> > thats the idea
> >
> > -nathan
> >

>
> There are no new ideas, just different spins to old ones.



i was alluding to the automatic invocation of ajax requests (the norm) in
your example vs. the required user interaction in the OPs.

-nathan

  Réponse avec citation
Vieux 09/04/2008, 08h34   #12
Jeremy O'Connor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component


""Nathan Nobbe"" <quickshiftin@gmail.com> wrote in message
news:7dd2dc0b0804080937x720af40n8f6850e807e246bd@m ail.gmail.com...
> On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor <joconnor@netactive.co.za>
> wrote:
> they pretty much have that in the scriptacuous lib under
> Ajax.Autocompleter,
> atm
>


OK, but my control only does the Ajax call when the user clicks the Go
button, whereas the scriptaculous library does an Ajax call everytime the
user presses a key.

--
Jeremy O'Connor


  Réponse avec citation
Vieux 09/04/2008, 13h50   #13
Eric Butera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor
<joconnor@netactive.co.za> wrote:
> OK, but my control only does the Ajax call when the user clicks the Go
> button, whereas the scriptaculous library does an Ajax call everytime the
> user presses a key.


Any library should be flexible enough to register event listeners on
whatever trigger needed. The event itself isn't as important as how
things are handled.

I use YUI because it lets me focus on my work instead of browser
quirks. It is a little heavier but that is okay because they have a
team dedicated to testing all the A grade browsers so I don't have to.
  Réponse avec citation
Vieux 09/04/2008, 13h59   #14
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor <joconnor@netactive.co.za>
wrote:

>
> ""Nathan Nobbe"" <quickshiftin@gmail.com> wrote in message
> news:7dd2dc0b0804080937x720af40n8f6850e807e246bd@m ail.gmail.com...
> > On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor <

> joconnor@netactive.co.za>
> > wrote:
> > they pretty much have that in the scriptacuous lib under
> > Ajax.Autocompleter,
> > atm
> >

>
> OK, but my control only does the Ajax call when the user clicks the Go
> button, whereas the scriptaculous library does an Ajax call everytime the
> user presses a key.



not quite; it checks to see if anything has been entered in intervals that
are specified by the frequency parameter. this allows users to potentially
enter in several characters depending on the frequency interval. with the
stock setting, i was able to type about 5 or 6 characters before an ajax
request was issued. and its smart enough not to just incite an ajax request
at every interval, because during the intervals, it checks to see if
anything has been entered.
you can easily analyze this behavior w/ the demo links i posted and
firebugs' net tab. furthermore it has the tokens option. tokens enforce a
tighter requirement on whether or not an autocompletion request will be
invoked; in the case of Ajax.Autocompleter that means sending an ajax
request to the server. not only do characters have to have been entered
during the frequency interval, but one of the token characters has to have
been entered. pretty slick if u ask me.
you could easily add support for explicit autocompletion request (eg. by
clicking a button) by subclassing Autocompleter.Base or one of the current
subclasses (Ajax.Autocompleter or Autocompleter.Local) as long as those
actually made sense for what you were trying to do.
so scriptaculous has supplied performance conscience, convenient (for users
and developers) controls and the ability to extend upon their work (using
prototypes oo features).

-nathan

  Réponse avec citation
Vieux 09/04/2008, 14h07   #15
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera <eric.butera@gmail.com> wrote:

> On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor
> <joconnor@netactive.co.za> wrote:
> > OK, but my control only does the Ajax call when the user clicks the Go
> > button, whereas the scriptaculous library does an Ajax call everytime

> the
> > user presses a key.

>
> Any library should be flexible enough to register event listeners on
> whatever trigger needed. The event itself isn't as important as how
> things are handled.
>
> I use YUI because it lets me focus on my work instead of browser
> quirks. It is a little heavier but that is okay because they have a
> team dedicated to testing all the A grade browsers so I don't have to.



any js lib worth mentioning these days fits that description and prototype /
scriptaculous is no exception. i wish it were modular, so i didnt have to
send the whole damn library out to the browser on every request, when i
might just need a few classes. whats more, although scriptaculous does
provide some ui components and controls out-of-the-box, they dont appear to
have nearly the gamut of extJs..
one of the things thats great about prototype is that they sort of map
javascripts oo model to something of the paradigm that php has; primarily
inheritance. i believe extJs errs more on the 'you need to understand js'
side of things.

-nathan

  Réponse avec citation
Vieux 09/04/2008, 14h35   #16
Eric Butera
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

On Wed, Apr 9, 2008 at 8:07 AM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
>
> On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera <eric.butera@gmail.com> wrote:
>
>
> > On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor
> >
> > <joconnor@netactive.co.za> wrote:
> >
> > > OK, but my control only does the Ajax call when the user clicks the Go
> > > button, whereas the scriptaculous library does an Ajax call everytime

> the
> > > user presses a key.

> >
> > Any library should be flexible enough to register event listeners on
> > whatever trigger needed. The event itself isn't as important as how
> > things are handled.
> >
> > I use YUI because it lets me focus on my work instead of browser
> > quirks. It is a little heavier but that is okay because they have a
> > team dedicated to testing all the A grade browsers so I don't have to.

>
> any js lib worth mentioning these days fits that description and prototype /
> scriptaculous is no exception. i wish it were modular, so i didnt have to
> send the whole damn library out to the browser on every request, when i
> might just need a few classes. whats more, although scriptaculous does
> provide some ui components and controls out-of-the-box, they dont appear to
> have nearly the gamut of extJs..
> one of the things thats great about prototype is that they sort of map
> javascripts oo model to something of the paradigm that php has; primarily
> inheritance. i believe extJs errs more on the 'you need to understand js'
> side of things.
>
> -nathan
>
>


I figured as much.

The YUI stuff is all very split up into defined modules such as DOM,
Event, Connection, etc. Of course they all seem to depend on each
other, so I end up sending like 8 files over the wire. I create a
single file to stitch them together though, gzip it, and send it with
a far future expire header. So in the end it really isn't the worst
thing.

I used prototype before but I was upset with my requests getting out
of order when I was doing stuff. Then there is lots of talk about how
it doesn't play nice with other scripts. The YUI stuff is all
namespaced out. I also had compatibility issues with prototype using
opera. But that was years ago and I'm sure everything is fine now,
but I've already left.
  Réponse avec citation
Vieux 09/04/2008, 14h44   #17
Zoltán Németh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] New Ajax search component

Eric Butera Ãrta:
> On Wed, Apr 9, 2008 at 8:07 AM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
>> On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera <eric.butera@gmail.com> wrote:
>>
>>
>>> On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor
>>>
>>> <joconnor@netactive.co.za> wrote:
>>>
>>>> OK, but my control only does the Ajax call when the user clicks the Go
>>>> button, whereas the scriptaculous library does an Ajax call everytime

>> the
>>>> user presses a key.
>>> Any library should be flexible enough to register event listeners on
>>> whatever trigger needed. The event itself isn't as important as how
>>> things are handled.
>>>
>>> I use YUI because it lets me focus on my work instead of browser
>>> quirks. It is a little heavier but that is okay because they have a
>>> team dedicated to testing all the A grade browsers so I don't have to.

>> any js lib worth mentioning these days fits that description and prototype /
>> scriptaculous is no exception. i wish it were modular, so i didnt have to
>> send the whole damn library out to the browser on every request, when i
>> might just need a few classes. whats more, although scriptaculous does
>> provide some ui components and controls out-of-the-box, they dont appear to
>> have nearly the gamut of extJs..
>> one of the things thats great about prototype is that they sort of map
>> javascripts oo model to something of the paradigm that php has; primarily
>> inheritance. i believe extJs errs more on the 'you need to understand js'
>> side of things.
>>
>> -nathan
>>
>>

>
> I figured as much.
>
> The YUI stuff is all very split up into defined modules such as DOM,
> Event, Connection, etc. Of course they all seem to depend on each
> other, so I end up sending like 8 files over the wire. I create a
> single file to stitch them together though, gzip it, and send it with
> a far future expire header. So in the end it really isn't the worst
> thing.
>
> I used prototype before but I was upset with my requests getting out
> of order when I was doing stuff. Then there is lots of talk about how
> it doesn't play nice with other scripts. The YUI stuff is all
> namespaced out. I also had compatibility issues with prototype using
> opera. But that was years ago and I'm sure everything is fine now,
> but I've already left.
>


I use prototype together with some parts of YUI, some parts of ExtJS,
TinyMCE, and a bunch of my own scripts, and there is no interference
between them. And it all seems to work on the latest opera.

greets,
Zoltán Németh
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,25436 seconds with 25 queries