Ext.form.field.Trigger自定义按钮样式及背景图

来源:互联网 发布:淘宝buy 宣传视频 编辑:程序博客网 时间:2024/06/05 11:28

1、引入trigger

id:'dataValue',
            header: '变量值标签',
            dataIndex: 'data',
            width: 105,
            editor: {
                xtype: 'triggerfield',
                triggerCls:'x-form-my-trigger',
                id:'datas',
                editable: false,
                onTriggerClick: openWin
            }


2、引入样式:

.x-form-my-trigger {
  background-image: url(images/form/test.gif) !important;
}

图片和其他样式可以自定义,注意,一定要加上边红色的部分,如果不加程序会自动引用ext-all.js中的样式;

3、.trigger几个比较重要的属性

  triggerCls:文本框右侧的按钮样式,主要有4种  

  1. x-form-clear-trigger     // the X icon  
  2. x-form-search-trigger    // the magnifying glass icon  
  3. x-form-trigger           // the down arrow (default for combobox) icon  
  4. x-form-date-trigger      // the calendar icon (just in case) 

  onTriggerClick:单击右侧按钮的事件

  emptyText:值为空时候显示的文字

  hideTrigger:是否显示触发按钮


原创粉丝点击