\Kendo\UI\Dialog
A PHP wrapper for Kendo UI Dialog.
Inherits from \Kendo\UI\Widget.
Usage
To use Dialog 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 Dialog
<?php
// Create a new instance of Dialog and specify its id
$dialog = new \Kendo\UI\Dialog('Dialog');
// Configure it
$dialog->animation(true)
// Output it
echo $dialog->render();
?>
Methods
addAction
Adds one or more DialogAction to the Dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value[, $value2, ...] \Kendo\UI\DialogAction|array
Example - using \Kendo\UI\DialogAction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$action = new \Kendo\UI\DialogAction();
$cssClass = 'value';
$action->cssClass($cssClass);
$dialog->addAction($action);
?>
Example - using array
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$cssClass = 'value';
$dialog->addAction(array('cssClass' => $cssClass));
?>
Example - adding more than one DialogAction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$first = new \Kendo\UI\DialogAction();
$second = new \Kendo\UI\DialogAction();
$dialog->addAction($first, $second);
?>
animation
A collection of {Animation} objects, used to change default animations. A value of false will disable all animations in the widget. is not a valid configuration.
Returns
\Kendo\UI\Dialog
Parameters
$value boolean|\Kendo\UI\DialogAnimation|array
Example - using boolean
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->animation(true);
?>
Example - using \Kendo\UI\DialogAnimation
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$animation = new \Kendo\UI\DialogAnimation();
$close = new \Kendo\UI\DialogAnimationClose();
$animation->close($close);
$dialog->animation($animation);
?>
Example - using array
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$close = new \Kendo\UI\DialogAnimationClose();
$dialog->animation(array('close' => $close));
?>
buttonLayout
Specifies the possible layout of the action buttons in the Dialog.Note: Stretched layout has no effect in browsers, like IE9, that do not support flexbox.Possible values are: normal or stretched.
Returns
\Kendo\UI\Dialog
Parameters
$value string
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->buttonLayout('value');
?>
closable
Specifies whether a close button should be rendered at the top corner of the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value boolean
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->closable(true);
?>
close
Triggered when a Dialog is closed (by a user or through the close() method). For additional information check the close event documentation.
Returns
\Kendo\UI\Dialog
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->close('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onClose(e) {
// handle the close event.
}
</script>
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->close('onClose');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->close(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
content
Sets the HTML content of the Dialog.
Returns
Dialog
$value string
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->content('<strong>Content</strong>');
?>
endContent
Stops output bufferring and sets the preceding markup as the content of the Dialog.
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->startContent();
?>
<strong>Content</strong>
<?php
$dialog->endContent(); // content is set to <strong>Content</strong>
?>
height
Specifies height of the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float|string
Example - using float
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->height(1);
?>
Example - using string
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->height('value');
?>
hide
Triggered when a Dialog has finished its closing animation. For additional information check the hide event documentation.
Returns
\Kendo\UI\Dialog
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->hide('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onHide(e) {
// handle the hide event.
}
</script>
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->hide('onHide');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->hide(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
initOpen
Triggered when a Dialog is opened for the first time (i.e. the open() method is called). For additional information check the initOpen event documentation.
Returns
\Kendo\UI\Dialog
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->initOpen('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onInitOpen(e) {
// handle the initOpen event.
}
</script>
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->initOpen('onInitOpen');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->initOpen(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
maxHeight
The maximum height (in pixels) that may be achieved by resizing the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->maxHeight(1);
?>
maxWidth
The maximum width (in pixels) that may be achieved by resizing the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->maxWidth(1);
?>
messages
Defines the text of the labels that are shown within the dialog. Used primarily for localization.
Returns
\Kendo\UI\Dialog
Parameters
$value \Kendo\UI\DialogMessages|array
Example - using \Kendo\UI\DialogMessages
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$messages = new \Kendo\UI\DialogMessages();
$close = 'value';
$messages->close($close);
$dialog->messages($messages);
?>
Example - using array
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$close = 'value';
$dialog->messages(array('close' => $close));
?>
minHeight
The minimum height (in pixels) that may be achieved by resizing the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->minHeight(1);
?>
minWidth
The minimum width (in pixels) that may be achieved by resizing the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->minWidth(1);
?>
modal
Specifies whether the dialog should show a modal overlay over the page.
Returns
\Kendo\UI\Dialog
Parameters
$value boolean|\Kendo\UI\DialogModal|array
Example - using boolean
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->modal(true);
?>
Example - using \Kendo\UI\DialogModal
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$modal = new \Kendo\UI\DialogModal();
$preventScroll = true;
$modal->preventScroll($preventScroll);
$dialog->modal($modal);
?>
Example - using array
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$preventScroll = true;
$dialog->modal(array('preventScroll' => $preventScroll));
?>
open
Triggered when a Dialog is opened (i.e. the open() method is called). For additional information check the open event documentation.
Returns
\Kendo\UI\Dialog
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->open('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onOpen(e) {
// handle the open event.
}
</script>
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->open('onOpen');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
show
Triggered when a Dialog has finished its opening animation. For additional information check the show event documentation.
Returns
\Kendo\UI\Dialog
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->show('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onShow(e) {
// handle the show event.
}
</script>
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->show('onShow');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->show(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
size
Set predefined size to the dialog. The width and height configuration options override the predefined size.Possible values are: auto; small; medium or large.
Returns
\Kendo\UI\Dialog
Parameters
$value string
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->size('value');
?>
startContent
Starts output bufferring. Any following markup will be set as the content of the Dialog.
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->startContent();
?>
<strong>Content</strong>
<?php
$dialog->endContent(); // content is set to <strong>Content</strong>
?>
themeColor
The themeColor option controls the color that will be applied.The following values are available for the themeColor: primary; dark; light or none.
Returns
\Kendo\UI\Dialog
Parameters
$value string
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->themeColor('value');
?>
title
The text in the dialog title bar. If false, the dialog will be displayed without a title bar.
Returns
\Kendo\UI\Dialog
Parameters
$value string|boolean
Example - using string
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->title('value');
?>
Example - using boolean
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->title(true);
?>
visible
Specifies whether the dialog will be initially visible.
Returns
\Kendo\UI\Dialog
Parameters
$value boolean
Example
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->visible(true);
?>
width
Specifies width of the dialog.
Returns
\Kendo\UI\Dialog
Parameters
$value float|string
Example - using float
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->width(1);
?>
Example - using string
<?php
$dialog = new \Kendo\UI\Dialog('Dialog');
$dialog->width('value');
?>