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!');

                    }

                }]

            });

        });

 

 

 

你可能感兴趣的:(trigger)