\Kendo\UI\OrgChart

A PHP wrapper for Kendo UI OrgChart.

Inherits from \Kendo\UI\Widget.

Usage

To use OrgChart in a PHP page instantiate a new instance, configure it via the available configuration methods and output it by echo-ing the result of the render method.

Using Kendo OrgChart

<?php
// Create a new instance of OrgChart and specify its id
$orgChart = new \Kendo\UI\OrgChart('OrgChart');

// Configure it
$orgChart->editable(true)

// Output it

echo $orgChart->render();
?>

Methods

cancel

Triggered when the user is about to cancel the changes for the currently edited node. Preventable. For additional information check the cancel event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->cancel('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onCancel(e) {
        // handle the cancel event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->cancel('onCancel');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->cancel(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

cardsColors

An array of strings defining the cards top-border color for each level starting from the top level. If not set, the colors from the Kendo Chart series will be used.

Returns

\Kendo\UI\OrgChart

Parameters

$value array

Example

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->cardsColors(array());
?>

change

Triggered when the selected node has been changed upon user interaction. For additional information check the change event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->change('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChange(e) {
        // handle the change event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->change('onChange');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->change(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

collapse

Triggered before a node has been collapsed upon user interaction. Preventable. For additional information check the collapse event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->collapse('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onCollapse(e) {
        // handle the collapse event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->collapse('onCollapse');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->collapse(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

create

Triggered when a node is about to be created upon user interaction. Preventable. For additional information check the create event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->create('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onCreate(e) {
        // handle the create event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->create('onCreate');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->create(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

dataBinding

Triggered before the actual change in the dataSource occurs. Preventable. For additional information check the dataBinding event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBinding('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDataBinding(e) {
        // handle the dataBinding event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBinding('onDataBinding');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBinding(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

dataBound

Triggered after the dataSource change event has been processed (adding/removing/loading/editing items). For additional information check the dataBound event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBound('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDataBound(e) {
        // handle the dataBound event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBound('onDataBound');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->dataBound(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

dataSource

Sets the data source of the widget.

Returns

\Kendo\UI\OrgChart

Parameters

$value \Kendo\Data\DataSource|array

Example - using \Kendo\Data\DataSource

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$dataSource = new \Kendo\Data\DataSource();
$orgChart->dataSource($dataSource);
?>

Example - using array

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$schema = new \Kendo\Data\DataSourceSchema();
$orgChart->dataSource(array('schema' => $schema));
?>

delete

Triggered when a node is about to be deleted as of a consequence of user interaction. Preventable. For additional information check the delete event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->delete('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDelete(e) {
        // handle the delete event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->delete('onDelete');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->delete(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

edit

Triggered when a node is about to enter edit mode upon user interaction. Preventable. For additional information check the edit event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->edit('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onEdit(e) {
        // handle the edit event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->edit('onEdit');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->edit(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

editable

If set to false, the user will not be able to edit the data to which the OrgChart is bound. By default, editing is enabled.The editable option can also be set to a JavaScript object (which represents the editing configuration).

Returns

\Kendo\UI\OrgChart

Parameters

$value boolean|\Kendo\UI\OrgChartEditable|array

Example - using boolean

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->editable(true);
?>

Example - using \Kendo\UI\OrgChartEditable

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$editable = new \Kendo\UI\OrgChartEditable();
$create = true;
$editable->create($create);
$orgChart->editable($editable);
?>

Example - using array

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$create = true;
$orgChart->editable(array('create' => $create));
?>

expand

Triggered before a node has been expanded upon user interaction. Preventable. For additional information check the expand event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->expand('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onExpand(e) {
        // handle the expand event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->expand('onExpand');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->expand(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

groupField

Specifies the field the nodes should be grouped by. If any value is passed, the OrgChart uses its grouping rendering mode.

Returns

\Kendo\UI\OrgChart

Parameters

$value string

Example

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->groupField('value');
?>

groupHeaderTemplate

Provides an option to customize the default template for the group label (using the field value and name by default).

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->groupHeaderTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->groupHeaderTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

messages

Provides configuration options for the messages present in the OrgChart widget.

Returns

\Kendo\UI\OrgChart

Parameters

$value \Kendo\UI\OrgChartMessages|array

Example - using \Kendo\UI\OrgChartMessages

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$messages = new \Kendo\UI\OrgChartMessages();
$cancel = 'value';
$messages->cancel($cancel);
$orgChart->messages($messages);
?>

Example - using array

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$cancel = 'value';
$orgChart->messages(array('cancel' => $cancel));
?>

save

Triggered when the user attempts to save the current changes on the edited node. Preventable. For additional information check the save event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->save('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSave(e) {
        // handle the save event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->save('onSave');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->save(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

select

Triggered when the user attempts to select a new node or group of nodes (in grouped scenario). Preventable. For additional information check the select event documentation.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->select('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSelect(e) {
        // handle the select event.
    }
</script>
<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->select('onSelect');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->select(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

template

Defines a node card template.

Returns

\Kendo\UI\OrgChart

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

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

Example - using \Kendo\JavaScriptFunction

<?php
$orgChart = new \Kendo\UI\OrgChart('OrgChart');
$orgChart->template(new \Kendo\JavaScriptFunction('function() { }'));
?>
In this article
Not finding the help you need?