sencha-touch-1.1-selectfield(combobox)如何设置默认选项

来源:互联网 发布:asp自动发卡源码 编辑:程序博客网 时间:2024/06/14 22:20

Sencha Touch 交流 QQ 群 224711028

1.将value为grid的option设置为默认项

Ext.getCmp('viewPortSelect').setValue('grid');
2.从controller覆盖原有option
Ext.getCmp('theSelect').setOptions([   {text: 'First Option',  value: 'first'},    {text: 'Second Option', value: 'second'},    {text: 'Third Option',  value: 'third'}]);

参考:http://stackoverflow.com/questions/7595669/how-to-make-the-default-text-in-a-select-field-grey-like-the-placeholder-for-tex