FR.QuickButton
Hierarchy
Files
按钮控件。可以设置不同的按钮风格。
var $div = $('<div>').appendTo('body');
var button = new FR.QuickButton({
renderEl : $div,
text : '按钮小学生',
decoration : 'line-through',
handler : function() {alert('我是一个小学生!')}
});
Defined By
Config options
options : JSON
配置属性 ...
配置属性
- alignment : 'center'/'left'/'right' (optional)
文字对齐方式
Defaults to:
'center'
- text : String
按钮上的文字
- icon : String (optional)
按钮的图标。形如: css:fr-btn-icon获取直接fr-btn-icon
- iconPath : String (optional)
按钮的图标路径
- iconWidth : Number (optional)
图标的宽度
Defaults to:
24
- iconHeight : Number (optional)
图标的高度
Defaults to:
16
- width : Number (optional)
按钮的宽度
Defaults to:
80
- height : Number (optional)
按钮的高度
Defaults to:
28
- style : 'blue'/'gray'/'green' (optional)
按钮的样式
Defaults to:
'blue'
- fontfamily : String (optional)
字体类型
- fontstyle : String (optional)
字体样式
- fontweight : String (optional)
字体粗细
- fontsize : String (optional)
字体大小,形如 12px
- decoration : 'none'/'underline'/'overline'/'line-through'/'inherit' (optional)
文字的修饰类型
- color : String (optional)
文字的颜色
Overrides: FR.Widget.options
Defined By
Properties
Defined By
Methods
fireEvent( eventName ) : Boolean
触发绑定过的事件 * * ...
触发绑定过的事件 * *
Parameters
- eventName : String
要触发的事件的名字 *
Returns
- Boolean
如果事件函数返回false,则返回false并中断其他同名事件的执行,否则执行所有的同名事件并返回true
isStringTypeNumber( o ) : boolean
"24"这种形式的 * ...
"24"这种形式的 *
Parameters
- o : Object
宽度或者高度 *
Returns
- boolean
是否是"24"这种形式
on( eventName, fn )
once( eventName, fn )
setEnable( enable )
设置控件的可用性 * ...
设置控件的可用性 *
Parameters
- enable : Boolean
如果参数值为true则设置控件为可用,如果参数值为false则设置控件为不可用
setSource( source )
设置控件的初始值,一般情况和setValue一样,在初始值为数据绑定的时候需要动态加载数据 * ...
设置控件的初始值,一般情况和setValue一样,在初始值为数据绑定的时候需要动态加载数据 *
Parameters
- source : Object
初始值
setVisible( visible )
设置控件的可见性 * ...
设置控件的可见性 *
Parameters
- visible : Boolean
如果参数值为true则设置控件为可见,如果参数值为false则设置控件为不可见
un( eventName, fn )