\Kendo\UI\ToolBar

A PHP wrapper for Kendo UI ToolBar.

Inherits from \Kendo\UI\Widget.

Usage

To use ToolBar 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 ToolBar

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

// Configure it
$toolBar->navigateOnTab(true)

// Output it

echo $toolBar->render();
?>

Methods

click

Fires when the user clicks a command button. For additional information check the click event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->click('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onClick(e) {
        // handle the click event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->click('onClick');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->click(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

close

Fires when the SplitButton's popup closes. For additional information check the close event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->close('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onClose(e) {
        // handle the close event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->close('onClose');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->close(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

addItem

Adds one or more ToolBarItem to the ToolBar.

Returns

\Kendo\UI\ToolBar

Parameters

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

Example - using \Kendo\UI\ToolBarItem

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$item = new \Kendo\UI\ToolBarItem();
$enable = true;
$item->enable($enable);
$toolBar->addItem($item);
?>

Example - using array

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$enable = true;
$toolBar->addItem(array('enable' => $enable));
?>

Example - adding more than one ToolBarItem

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$first  = new \Kendo\UI\ToolBarItem();
$second = new \Kendo\UI\ToolBarItem();
$toolBar->addItem($first, $second);
?>

If set to true this configuration option would enable Tab-based navigation among ToolBar items.

Returns

\Kendo\UI\ToolBar

Parameters

$value boolean

Example

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->navigateOnTab(true);
?>

open

Fires when the Split Button's popup opens. For additional information check the open event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->open('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onOpen(e) {
        // handle the open event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->open('onOpen');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

overflowClose

Fires when the overflow popup container is about to close. For additional information check the overflowClose event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowClose('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onOverflowClose(e) {
        // handle the overflowClose event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowClose('onOverflowClose');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowClose(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

overflowOpen

Fires when the overflow popup container is about to open. For additional information check the overflowOpen event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowOpen('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onOverflowOpen(e) {
        // handle the overflowOpen event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowOpen('onOverflowOpen');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->overflowOpen(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

resizable

If resizable is set to true the widget will detect changes in the viewport width and hides the overflowing controls in the command overflow popup.

Returns

\Kendo\UI\ToolBar

Parameters

$value boolean

Example

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->resizable(true);
?>

size

Controls the overall physical size of the ToolBar and its items. Valid values are: "small", "medium", "large", and "none". Default value is "medium".

Returns

\Kendo\UI\ToolBar

Parameters

$value string

Example

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->size('value');
?>

toggle

Fires when the user changes the checked state of a toggle button. For additional information check the toggle event documentation.

Returns

\Kendo\UI\ToolBar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->toggle('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onToggle(e) {
        // handle the toggle event.
    }
</script>
<?php
$toolBar = new \Kendo\UI\ToolBar('ToolBar');
$toolBar->toggle('onToggle');
?>

Example - using \Kendo\JavaScriptFunction

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