inane
inane

Reputation: 648

Set the list value on the searchfield in Sencha touch

I have this method on the controller

   onResponsibleSuggestListTap: function (list, index, target, record, event, eOpts) {
    var activityGeneral = this.getActivityGeneral();
    //set the text field value
    activityGeneral.down('#responsible').setValue(record.get('value'));
    console.log(record.get('value'));
    //hide out floating list
    this.getResponsibleSuggest().destroy();

    //clear the drop down list
    this.onClearResponsibleField();
},

and in the view:

items: [
                {
                    xtype: 'container',
                    width: '60%',
                    padding: '0 3px 0 0',
                    items: [
                        {
                            xtype: 'searchfield',
                            itemId: 'responsibleSearchField',
                            placeHolder: 'introduces..."
                        }
                    ]
                }
       ]

But I cannot set the value after the click on the item in the searchfield, what am i doing wrong??

Thanks a lot!

Upvotes: 1

Views: 302

Answers (1)

Naresh Tank
Naresh Tank

Reputation: 1568

try after change as per below

activityGeneral.query('searchfield[itemId=responsibleSearchField]')[0].setValue(record.get('value'));

Upvotes: 1

Related Questions