1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    73
    Vote Rating
    -1
    PhilChill is an unknown quantity at this point

      0  

    Default Unanswered: autocomplete textfield with a list

    Unanswered: autocomplete textfield with a list


    Hey guys,

    I want to use autocomplete with a textfield. I found out a good way is to use a list and to use the focus event of the textfield in addition with an Interval. To get the results for the autocomplete I'm using an JSON-RPC call. My problem is to show the results in the list then.

    Here is my code so far
    Code:
    items: [{
                    xtype: 'textfield',
                    id   : 'nameTo',
                    name : 'nameTo',
                    label: Lg['NAME'],   // contact.getCustomerByEmailOrName
                    listeners: {
                        focus: function(){
                            var nameToField = Ext.getCmp('nameTo');
                            var list = new Ext.List;
                            var store = Ext.getStore('automcompletes').load({
                                addRecords:true
                            })
                            MobileLogin._autoCompleteTimer = setInterval(function(){                        
                                MobileLogin.app.callFn('contact.getContactByNameOrEmail', function(result, error)                            
                                    for(i=0;i<result.contacts.length;i++){
                                    var instance =  Ext.create('MobileLogin.model.Autocomplete', {
                                            email: result.contacts[i].email,
                                            name : result.contacts[i].name
                                        });
                                        store.add(instance);
                                    }
                                    console.log(store.getAt(0));
                                    list.setStore(store);
                                    list.setRecord(store);
                                    console.log(list.getAt(0));
                                    list.show();
                                },[nameToField.getValue(), 5 ]);
                            }, 3000);                        
                        }
                    }
                },
    I'm trying with list.show() to show the list but that is not working How can i show the list?

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Answers
    64
    Vote Rating
    20
    haduki will become famous soon enough haduki will become famous soon enough

      0  

    Default


    showBy
    I write English by translator.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    73
    Vote Rating
    -1
    PhilChill is an unknown quantity at this point

      0  

    Default


    showBy is not working by me

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,700
    Answers
    3356
    Vote Rating
    749
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by PhilChill View Post
    showBy is not working by me
    Probably because the list doesn't have a size to it
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    73
    Vote Rating
    -1
    PhilChill is an unknown quantity at this point

      0  

    Default


    Yes that was the problem i fixed it now
    If somebody is interested in the complete code here is it
    Code:
    {				xtype: 'textfield',
    				id   : 'nameTo',
    				name : 'nameTo',
    				label: Lg['NAME'],  
    				listeners: {
    					focus: function(){
    						var nameToField = Ext.getCmp('nameTo');
    						var list = new Ext.List;
    						var store = Ext.getStore('automcompletes').load({
    							addRecords:true
    						})
    						MobileLogin._autoCompleteTimer = setInterval(function(){
    						
    			MobileLogin.app.callFn('contact.getContactByNameOrEmail', function(result, error)								for(i=0;i<result.contacts.length;i++){
    					var instance =  Ext.create('MobileLogin.model.Autocomplete', {
    										email: result.contacts[i].email,
    										name : result.contacts[i].name
    									});
    									store.add(instance);
    								}
    								list.setStore(store);
    								list.setRecord(store);
    								list.setSize(285,75);
    								list.setItemTpl('{email} {name}');
    								list.showBy(nameToField, "tl-cl");
    							},[nameToField.getValue(), 5 ]);
    						}, 3000);						
    					}
    				}
    			},

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    QuestSencha is on a distinguished road

      0  

    Default


    not working for me give some other example

    getting error

    Uncaught TypeError: Object manmee has no method 'getPageBox'

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