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种
- x-form-clear-trigger // the X icon
- x-form-search-trigger // the magnifying glass icon
- x-form-trigger // the down arrow (default for combobox) icon
- x-form-date-trigger // the calendar icon (just in case)
onTriggerClick:单击右侧按钮的事件
emptyText:值为空时候显示的文字
hideTrigger:是否显示触发按钮