- 最后登录
- 2024-6-3
- 注册时间
- 2009-10-16
- 阅读权限
- 100
- 积分
- 18803
- 纳金币
- 17488
- 精华
- 1
|
Editable Text (Text Behavior)
Summary
Enables editing for a text object, when focused.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 2.0.5 of the 'Editable Text' behavior, current as of 2005-Apr-08)
Description
If
Start Editable?
is checked, the last object with this behavior will be focused and editable. (If not, the user has to click on the text object to start editing it.)
If
Max Characters
is greater than 0, the user will not be able to type more characters than the specified number. If
Single Line?
is checked, the user will not be able to add new lines.
Note that this behavior does not support copy, paste, selecting multiple characters, or using the mouse to move the insertion point.
This behavior uses the
Focusable
behavior to track which text object is selected; see that behavior for events which may fire on the parent object. Note that if you want to dynamically change the text in the text object, be sure to blur the text object (invoking the custom
.blur()
method on the text object, the
.blurParent()
method on this behavior, or the
Blur Parent
action on this behavior) before changing the contents of the text object.
Basic Properties
Start Editable?
Should this text object start out with focus?
Max Characters
Maximum number of characters to allow (0 for unlimited)
Numeric Only?
Only allow digits to be typed?
Single Line?
Only allow a single line to be typed?
Actions
Focus Parent
Move focus to the parent element.
Blur Parent
Remove focus from the parent element.
Events
Edit Start
Fires when the text starts being edited.
Edit Complete
Fires when the text is done being edited.
Demonstration
View Demonstration Project
Download Project File
|
|