-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy patheasyui-textbox.java
More file actions
173 lines (124 loc) · 2.83 KB
/
easyui-textbox.java
File metadata and controls
173 lines (124 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---------------------------
EasyUI-textbox |
---------------------------
# TextBox(文本框)是一个增强的输入字段组件, 它允许用户非常简单的创建一组表单。它是一个用于构建其他组合控件的基础组件,如:combo,databox、spinner等
# 继承关系
validatebox
linkbutton
---------------------------
EasyUI-textbox 属性|
---------------------------
width
* 组件的宽度
height
* 组件的高度
prompt
* 在输入框显示的提示信息
value
* 默认值
type
* 文本框类型。可用值有:"text"和"password"。
multiline
* 定义是否是多行文本框。
editable
* 定义用户是否可以直接在该字段内输入文字。
disabled
* 定义是否禁用该字段。
readonly
* 定义该控件是否只读
icons
* 参数是一个数组
* 在文本框删贡献是图标。每一项都有以下属性:
iconCls //类型string,图标的class名称;
disabled //类型boolean,指明是否禁用该图标;
handler //类型function,用于处理点击该图标以后的动作。
$('#tb').textbox({
icons: [{
iconCls:'icon-add',
handler: function(e){
$(e.data.target).textbox('setValue', 'Something added!');
}
},{
iconCls:'icon-remove',
handler: function(e){
$(e.data.target).textbox('clear');
}
}]
})
iconCls
* 在文本框显示背景图标
iconAlign
* 背景图标位置.值有:"left", "right"。
iconWidth
* 图标的宽度
buttonText
* 文本框附加按钮显示的文本内容。
buttonIcon
* 文本框附加按钮显示的图标。
buttonAlign
* 附件摁钮的位置,可拥有的值有:"left", "right"。
---------------------------
EasyUI-textbox 事件|
---------------------------
'事件扩展自 validatebox,以下是新增的文本框事件。'
onChange
* 在字段值更改的时候触发
* newValue, oldValue
onResize
* 在文本框大小更改的时候触发
* width, height
onClickButton
* 在用户点击摁钮的时候触发
onClickIcon
* 在用户点击图标的时候触发
* index
---------------------------
EasyUI-textbox 方法|
---------------------------
'方法扩展自 validatebox,以下是新增的文本框方法。'
options
* 返回属性对象
textbox
* 返回文本框对象
* demo
var t = $('#tt');
t.textbox('textbox').bind('keydown', function(e){
if (e.keyCode == 13){ // 当按下回车键时接受输入的值。
t.textbox('setValue', $(this).val());
}
});
button
* 返回摁钮对象
destroy
* 销毁文本框组件
resize
* 调整文本框组件宽度
* 参数是 width
disable
* 禁用组件
enable
* 启用组件
readonly
* 启用/禁用只读模式
* demo
$('#tb').textbox('readonly'); // 启用只读模式
$('#tb').textbox('readonly',true); // 启用只读模式
$('#tb').textbox('readonly',false); // 禁用只读模式
clear
* 清除组件中的值
reset
* 重置组件中的值
initValue
* 初始化组件值。调用该方法不会触发“onChange”事件。
setText
* 设置显示的文本值
* 参数:text
getText
* 获取显示的文本值
setValue
* 设置组件的值
* 参数:value
getValue
* 获取组件的值
getIcon
* 获取指定图标对象