1. #1
    Ext User
    Join Date
    Nov 2008
    Location
    Phoenix, AZ
    Posts
    13
    Vote Rating
    0
    ntilekt is on a distinguished road

      0  

    Thumbs up [Solved] Simple Autocomplete on Form Fields

    [Solved] Simple Autocomplete on Form Fields


    Hello all,

    I realize that there are several other posts on similar topics, but none seemed to answer my question. Perhaps I am just searching for the wrong string.

    Anyway, I want to just enable the normal browser autocomplete for Ext form fields. How can I go about doing that?

    I noticed that Ext set autocomplete='off' by default. I don't see a config option in either the FormPanel or TextField config to enable it.

    Thanks in advance,
    Nate
    Last edited by ntilekt; 18 Dec 2008 at 10:51 AM. Reason: problem solved

  2. #2
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    fangzhouxing is on a distinguished road

      0  

    Default


    I also want to ask the same question.

  3. #3
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    use the autoCreate config, and plug in a DomHelper template of your choice:
    http://extjs.com/docs/?class=Ext.for...ber=autoCreate

  4. #4
    Ext User
    Join Date
    Nov 2008
    Location
    Phoenix, AZ
    Posts
    13
    Vote Rating
    0
    ntilekt is on a distinguished road

      0  

    Default


    Ahh I see! Thanks Mystix! You know, I looked all through the docs, reading through what I thought would be the "relevant" configs for textfields and form panels. I didn't even consider autoCreate.

    So if I use autoCreate, do I have to specify all of the parameters? Or can I just do the following:

    PHP Code:
    autoCreate: {autocomplete"on"

  5. #5
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    I'm pretty sure it's an all or none. I posted a request sometime back that the code be modified to use an ApplyIf instead of Apply, but was shunned. Anything you specify becomes the config as a result. ApplyIf would make this much easier IMO.

  6. #6
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    yeah it's an all or nothing thing.

    to get around that (i.e. to do @ntilekt what is asking for) use the following override:
    Code:
    Ext.override(Ext.Component, {
        getAutoCreate : function() {
            var cfg = typeof this.autoCreate == "object" ?
                      Ext.apply({}, this.autoCreate, this.defaultAutoCreate) : Ext.apply({}, this.defaultAutoCreate);
            if (this.id && !cfg.id) {
                cfg.id = this.id;
            }
            return cfg;
        }
    });
    @mj -- do you have a link to the original Feature Request?
    i'd like to bump it again with a link back to this thread

  7. #7
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    fangzhouxing is on a distinguished road

      0  

    Default


    hi,ntilekt,I have applied mystix's override code and add autoCreate: {autocomplete: "on"} , but it still has no effect. My code here:
    Code:
    				fieldLabel : 'User Name',
    				name : 'username',
    				tabIndex : 1,
    				autoCreate: {autocomplete: "on"}, 
    				width : 150
    I use Ext.Ajax.request to save the form data.

  8. #8
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by fangzhouxing View Post
    hi,ntilekt,I have applied mystix's override code and add autoCreate: {autocomplete: "on"} , but it still has no effect. My code here:
    Code:
    				fieldLabel : 'User Name',
    				name : 'username',
    				tabIndex : 1,
    				autoCreate: {autocomplete: "on"}, 
    				width : 150
    I use Ext.Ajax.request to save the form data.
    check the html source -- is that textfield's autocomplete html attribute correct?

  9. #9
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    fangzhouxing is on a distinguished road

      0  

    Default


    I have checked the textfield's autocomplete html attribute, and it was there and was 'on', and the browser's settings was no problem also.

  10. #10
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by fangzhouxing View Post
    I have checkd the textfield's autocomplete html attribute, and it was there and was 'on', and the browser's settings was no problem also.
    if you create a plain old html <input> field via markup (with attribute autocomplete="on"), does that work for you in Fx?

    have you tried copying the markup from the generated TextField and pasting that into a plain old html page?

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar