Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Autocomplete Text Box like google

  1. #1

    Default Autocomplete Text Box like google

    Hi, can we have a auto complete text-box like Google search text box??

    Right now I have just implemented the auto-complete combo-box with hide trigger and local array.

    Now on every key press there will be a ajax request to a server , which returns a json, using this JSON i want to show the options.

    Is this possible ?

  2. #2
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441

    Default

    hm...
    have you looked to the examples?
    There's one which does exactly fit your needs..

    http://www.sencha.com/deploy/dev/exa...um-search.html

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    That example has been temporarily disabled.

    But for the OP: JUst configure a ComboBox with

    Code:
    mode: 'remote',
    hideTrigger: 'true'
    And it will query the server during typing (as soon as you leave the keys for 250ms, it sends the query), and show suggestions.

  4. #4

    Default

    It doesn't seem to work!

    The url is not right!

  5. #5

    Default

    Hi Animal

    The text in the combo-box should be sent as a parameter , How should i mention it in the baseParams ??

  6. #6
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441

    Default

    have you looked at the code of the example above? Even if the url is wrong, it works in exactly that way..

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    It sends the text automatically.

    You can change the name of the HTTP parameter it send it in if you really need to.

    http://www.sencha.com/deploy/dev/doc...ber=queryParam

  8. #8

    Default

    Quote Originally Posted by Animal View Post
    It sends the text automatically.

    You can change the name of the HTTP parameter it send it in if you really need to.

    http://www.sencha.com/deploy/dev/doc...ber=queryParam
    Yes this is what i needed!

  9. #9

    Default

    The parameter which should be sent to server is text.prefix

    in the store i mention

    Code:
    baseParams:{
    terms.prefix='prefix'
    }
    in the combo-box i specify
    Code:
    queryParam:'prefix'
    its not working!

  10. #10
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Shouldn't that be:
    Code:
    baseParams:{
     'terms.prefix': 'prefix'
    }
    and:
    Code:
    queryParam: 'text.prefix'

Page 1 of 2 12 LastLast

Similar Threads

  1. TextField + Autocomplete like Google!
    By betoneto.tbo in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 13 May 2009, 5:38 AM
  2. Setting initial value for autocomplete Combo Box
    By nightwatch in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 29 Dec 2008, 6:30 AM
  3. ComboBox - Force close of 'autocomplete' box
    By smittix in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Jul 2008, 6:06 PM
  4. BasicDialog with Autocomplete Box
    By brant in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 10 Nov 2006, 2:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •