简体   繁体   中英

How to custom list inside of selectfield of Sencha Touch app?

I would like to custom the list of the selectfield in a Sencha Touch app, for example I need to indicate variableHeight parameter because I have texts very long..

Thank you

Step 1 you need to add a custom css to your selectfield-list.

a) onFocus of the selectfield you need to change the width of the listPanel

onFocus: function (e) {
    this.callParent(arguments);
    this.listPanel.setWidth(180);
}

OR

a) get the selectfield when the listPanel is shown

sf = Ext.Viewport.down('selectfield[action=mySelectfield]');

b) set the width of the panel

sf.listPanel.setWidth(180)

OR

use css:

.x-select-overlay{
    .x-list {
        x-list-item {
            ---> here goes your code
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM