0

下面是带有默认文本的组合框的 ExtJs3.2 代码。当我单击组合框时,默认文本不会消失,而是被选中。您还可以通过输入姓名的首字母来组合搜索姓名。我应该怎么做才能不选择默认文本并且在我单击内部组合时应该消失。

{
                                            xtype: 'combo',
                                            displayField: 'name',
                                            emptyText:'Select Route'+"*",
                                            id: 'road-edit-form-roadList',
                                            allowBlank: false,
                                            forceSelection :true,
                                            typeAhead: true,
                                            triggerAction: 'all',
                                            mode: 'local',
                                            valueField:'id',
                                            store: new Ext.data.JsonStore({
                                                   //url: 'getRoadList',
                                                   url: 'ajax-route/ajax.jsp?action=getRoadList',
                                                   fields: ['id','name']
                                            }),
                                            listeners:{
                                                   'beforequery': function(qe){
                                                          qe.combo.getStore().load({
                                                                 params:{
                                                                       query:qe.query
                                                                 }
                                                          });
                                                   }
                                            }
                                     }
4

1 回答 1

0

尝试添加

focus : function (thisCmp, eventObj, eventOptions) {
            thisCmp.inputEl.dom.placeholder = ''; //force the removal of the placeholding text
        }

更多参考:http ://www.sencha.com/forum/showthread.php?230850-combo-with-watermark-problem

于 2013-10-10T10:53:31.920 回答