EasyUI
TextEditor
Extension » TextEditor
Create TextEditor
Create from markup
Create using javascript.
Properties
The properties extend from dialog, below is the added properties for texteditor.
| Name | Type | Description | Default |
|---|---|---|---|
| name | string | The form field name. | |
| toolbar | array | The top toolbar of the texteditor. | ['bold','italic','strikethrough','underline','-','justifyleft','justifycenter','justifyright','justifyfull','-','insertorderedlist','insertunorderedlist','outdent','indent','-','formatblock','fontname','fontsize','lineheight'] |
| commands | object |
The command definitions.
Code example:
$.extend($.fn.texteditor.defaults.commands, {
'bold': {
type: 'linkbutton',
iconCls: 'icon-bold',
onClick: function(){
$(this).texteditor('getEditor').texteditor('execCommand','bold');
}
}
});
|
Events
The events extend from dialog.
Methods
The methods extend from dialog, below is the added methods for texteditor.
| Name | Parameter | Description |
|---|---|---|
| options | none | Return the options property. |
| execCommand | cmd | Execute a command. |
| getEditor | none | Get the editor object. |
| insertContent | html | Insert the html at the current cursor position. |
| destroy | none | Destroy the texteditor. |
| getValue | none | Get the texteditor value. |
| setValue | html | Set the texteditor value. |
| clear | none | Clear the texteditor value. |
| reset | none | Reset the texteditor value. |
| disable | none | Disable the texteditor component. |
| enable | none | Enable the texteditor component. |
| readonly | mode | Enable/Disable readonly mode. |
