\Kendo\UI\EditorTool

A PHP class representing the tool setting of EditorTools.

Methods

columns

Specifies the colors columns for "foreColor" and "backColor" tools when list of colors are defined.

Returns

\Kendo\UI\EditorTool

Parameters

$value float

Example

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->columns(1);
?>

exec

The JavaScript function which will be executed when the end-user clicks the tool button.

Returns

\Kendo\UI\EditorTool

Parameters

$value \Kendo\JavaScriptFunction

Example

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->exec(new \Kendo\JavaScriptFunction('function() { }'));
?>

addItem

Adds one or more EditorToolItem to the EditorTool.

Returns

\Kendo\UI\EditorTool

Parameters

$value[, $value2, ...] \Kendo\UI\EditorToolItem|array

Example - using \Kendo\UI\EditorToolItem

<?php
$tool = new \Kendo\UI\EditorTool();
$item = new \Kendo\UI\EditorToolItem();
$context = 'value';
$item->context($context);
$tool->addItem($item);
?>

Example - using array

<?php
$tool = new \Kendo\UI\EditorTool();
$context = 'value';
$tool->addItem(array('context' => $context));
?>

Example - adding more than one EditorToolItem

<?php
$tool = new \Kendo\UI\EditorTool();
$first  = new \Kendo\UI\EditorToolItem();
$second = new \Kendo\UI\EditorToolItem();
$tool->addItem($first, $second);
?>

name

When specifying a tool as an object, a tool name is required. Please note that "undo" and "redo" are reserved tool names.

Returns

\Kendo\UI\EditorTool

Parameters

$value string

Example

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->name('value');
?>

palette

Specifies the color palette for "foreColor" and "backColor" tools. If you need to use the color gradient view in the picker instead of the palette, set this value to null.

Returns

\Kendo\UI\EditorTool

Parameters

$value string|array

Example - using string

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->palette('value');
?>

Example - using array

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->palette(array());
?>

template

The kendo template that will be used for rendering the given tool.

Returns

\Kendo\UI\EditorTool

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->template('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->template(new \Kendo\JavaScriptFunction('function() { }'));
?>

tooltip

The text which will be displayed when the end-user hovers the tool button with the mouse.

Returns

\Kendo\UI\EditorTool

Parameters

$value string

Example

<?php
$tool = new \Kendo\UI\EditorTool();
$tool->tooltip('value');
?>

ui

Apart from the built-in tools, the Editor fully exposes the ToolBar.items API. This way you can specify any custom tools in the widget using the components available in the ToolBar itself.All tools must have their name specified. All custom tools with no name will have "custom" automatically assigned as their name. As a result only one of them will be placed in the Editor ToolBar.

Returns

\Kendo\UI\EditorTool

Parameters

$value ``
In this article
Not finding the help you need?