ExtJS4 带清除功能的文本框 triggerfield

 

 Ext.onReady(function () {
            Ext.create('Ext.form.FormPanel', {
                title: 'Form with TriggerField',
                bodyPadding: 5,
                width: 350,
                renderTo: Ext.getBody(),
                items: [{
                    xtype: 'triggerfield',
                    selectOnFocus: true,
                    fieldLabel: 'Sample Trigger',
                    trigger1Cls: 'x-form-clear-trigger',
                    trigger2Cls: 'x-form-search-trigger',
                    onTrigger1Click: function () {
                        this.setValue('');
                    },
                    onTrigger2Click: function () {
                        Ext.Msg.alert('Status', 'You clicked search!');
                    }
                }]
            });
        });

 

 

 

posted @ 2013-09-02 10:46  高山-景行  阅读(978)  评论(1编辑  收藏  举报