BizApps
BizApps

Reputation: 6130

How to reset or deselect highlighted item on selectfield in Sencha Touch

Good Day!

I have a selectfield which i need to reset or deselect highlighted item on it after selecting an item.

Below is my code:

xtype: 'selectfield',
id: 'slActionRequired',
placeHolder: 'SELECT ACTION REQUIRED',
name: 'ActionRequired',
label: 'Action Required<span style="color:red">*</span>',
autoSelect: false,
usePicker: false,
options: [
{ text: 'YES', value: 'YES' },
{ text: 'NO', value: 'NO' }
],

I tried below code but nothing works:

Ext.ComponentQuery.query('#slActionRequired')[0].reset()
Ext.ComponentQuery.query('#slActionRequired')[0].setValue('');

Any help is appreciated.

Thanks

Upvotes: 1

Views: 1579

Answers (1)

Jeff Martin
Jeff Martin

Reputation: 560

You can extend the Ext.field.Select class and modify the item selection in the showPicker function.

Ext.define('Ux.field.Select', {
    extend: 'Ext.field.Select'
    xtype: 'myselectfield',


    showPicker: function() {
      ...

     // Modify the last line of the showPicker function
     // Remove the item selection when the select field is displayed.
     //list.select(record, null, true);


    }
}

Upvotes: 1

Related Questions