我应该怎么做才能选择默认文本,当我点击组合内部时(ExtJs3.2)它应该消失?

时间:2013-10-10 05:01:02

标签: extjs xtype

下面是带有默认文本的组合框的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
                                                                 }
                                                          });
                                                   }
                                            }
                                     }

1 个答案:

答案 0 :(得分: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