Extension » TextEditor

Create TextEditor

Create from markup

Create using javascript.


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']
commands object The command definitions.

Code example:

$.extend($.fn.texteditor.defaults.commands, {
	'bold': {
		type: 'linkbutton',
		iconCls: 'icon-bold',
		onClick: function(){


The events extend from dialog.


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.
disable none Disable the texteditor component.
enable none Enable the texteditor component.
readonly mode Enable/Disable readonly mode.

Download the EasyUI Extension: