\Kendo\UI\PropertyGrid

A PHP wrapper for Kendo UI PropertyGrid.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$propertyGrid->contextMenu(true)

// Output it

echo $propertyGrid->render();
?>

Methods

beforeEdit

Fires when the user tries to edit a data item before the editor is created. Can be used for preventing the editing depending on custom logic. The event handler function context (available through the this keyword) will be set to the component instance. The event will be fired only when the PropertyGrid is editable. For additional information check the beforeEdit event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->beforeEdit('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onBeforeEdit(e) {
        // handle the beforeEdit event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->beforeEdit('onBeforeEdit');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->beforeEdit(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

cancel

Fires when the user closes the edit cell via the Esc key or when the Reset command from the ContextMenu is executed. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the cancel event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

cellClose

Fires when the incell edit mode is used and the cell will be closed. The event is triggered after saving or canceling the changes but before the cell is closed. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the cellClose event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->cellClose('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onCellClose(e) {
        // handle the cellClose event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->cellClose('onCellClose');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->cellClose(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

change

Fires when the user selects a table row in the PropertyGrid. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the change event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

collapse

Fires when an item is about to be collapsed. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the collapse event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

columnResize

Fires when the user resizes a column via the Resize contextMenu command. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the columnResize event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->columnResize('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnResize(e) {
        // handle the columnResize event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->columnResize('onColumnResize');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->columnResize(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columns

The configuration of the PropertyGrid columns which allows for setting the field and value column configuration options.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value \Kendo\UI\PropertyGridColumns|array

Example - using \Kendo\UI\PropertyGridColumns

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$columns = new \Kendo\UI\PropertyGridColumns();
$fieldColumn = new \Kendo\UI\PropertyGridColumnsFieldColumn();
$columns->fieldColumn($fieldColumn);
$propertyGrid->columns($columns);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$fieldColumn = new \Kendo\UI\PropertyGridColumnsFieldColumn();
$propertyGrid->columns(array('fieldColumn' => $fieldColumn));
?>

contextMenu

Configures the ContextMenu of the PropertyGrid. If set to true enables the default ContextMenu.

Returns

\Kendo\UI\PropertyGrid

Parameters

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

Example - using boolean

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->contextMenu(true);
?>

Example - using \Kendo\UI\PropertyGridContextMenu

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$contextMenu = new \Kendo\UI\PropertyGridContextMenu();
$body = new \Kendo\UI\PropertyGridContextMenuBody();
$contextMenu->body($body);
$propertyGrid->contextMenu($contextMenu);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$body = new \Kendo\UI\PropertyGridContextMenuBody();
$propertyGrid->contextMenu(array('body' => $body));
?>

edit

Fires when the user edits a data item. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the edit event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

editMode

If set to true, the user will be able to edit the values of the object's properties to which the PropertyGrid is bound. By default, editing is enabled. can also be set to a string (which specifies the edit mode).The supported string values are: (Default) incell.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean|string

Example - using boolean

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->editMode(true);
?>

Example - using string

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->editMode('value');
?>

excel

Configures the Excel export settings of the PropertyGrid.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value \Kendo\UI\PropertyGridExcel|array

Example - using \Kendo\UI\PropertyGridExcel

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$excel = new \Kendo\UI\PropertyGridExcel();
$fileName = 'value';
$excel->fileName($fileName);
$propertyGrid->excel($excel);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$fileName = 'value';
$propertyGrid->excel(array('fileName' => $fileName));
?>

excelExport

Fires when the user clicks the Export to Excel toolbar button. For additional information check the excelExport event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->excelExport('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onExcelExport(e) {
        // handle the excelExport event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->excelExport('onExcelExport');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->excelExport(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

expand

Fires when an item is about to be expanded. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the expand event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

groupCollapse

Fires when a group of items is about to be collapsed. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the groupCollapse event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupCollapse('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onGroupCollapse(e) {
        // handle the groupCollapse event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupCollapse('onGroupCollapse');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupCollapse(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

groupExpand

Fires when a group of items is about to be expanded. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the groupExpand event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupExpand('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onGroupExpand(e) {
        // handle the groupExpand event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupExpand('onGroupExpand');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupExpand(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

groupable

Enables the grouping of properties. Set this configuration to false to disable grouping.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->groupable(true);
?>

height

Sets the height of the PropertyGrid. Numeric values are treated as pixels.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value float

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->height(1);
?>

addItem

Adds one or more PropertyGridItem to the PropertyGrid.

Returns

\Kendo\UI\PropertyGrid

Parameters

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

Example - using \Kendo\UI\PropertyGridItem

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$item = new \Kendo\UI\PropertyGridItem();
$description = 'value';
$item->description($description);
$propertyGrid->addItem($item);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$description = 'value';
$propertyGrid->addItem(array('description' => $description));
?>

Example - adding more than one PropertyGridItem

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$first  = new \Kendo\UI\PropertyGridItem();
$second = new \Kendo\UI\PropertyGridItem();
$propertyGrid->addItem($first, $second);
?>

messages

Defines the text of the command buttons that are shown within the PropertyGrid. Used primarily for localization.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value \Kendo\UI\PropertyGridMessages|array

Example - using \Kendo\UI\PropertyGridMessages

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$messages = new \Kendo\UI\PropertyGridMessages();
$defaultGroupName = 'value';
$messages->defaultGroupName($defaultGroupName);
$propertyGrid->messages($messages);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$defaultGroupName = 'value';
$propertyGrid->messages(array('defaultGroupName' => $defaultGroupName));
?>

model

Defines the model to which the PropertyGrid is bound to.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value ``

If set to true, the user can navigate the component with the keyboard. By default, keyboard navigation is disabled.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->navigatable(true);
?>

pdf

Configures the PDF export settings of the PropertyGrid.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value \Kendo\UI\PropertyGridPdf|array

Example - using \Kendo\UI\PropertyGridPdf

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$pdf = new \Kendo\UI\PropertyGridPdf();
$author = 'value';
$pdf->author($author);
$propertyGrid->pdf($pdf);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$author = 'value';
$propertyGrid->pdf(array('author' => $author));
?>

pdfExport

Fires when the user clicks the Export to PDF toolbar button. For additional information check the pdfExport event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->pdfExport('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onPdfExport(e) {
        // handle the pdfExport event.
    }
</script>
<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->pdfExport('onPdfExport');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->pdfExport(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

resizable

When set to true the user will be able to resize columns via the context menu. When set to false the ContextMenu Resize command will not be available.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean

Example

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

save

Fires when a data item is saved. The event handler function context (available through the this keyword) will be set to the component instance. For additional information check the save event documentation.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

scrollable

If set to true, the PropertyGrid will display a scrollbar when the total row height or width exceeds the PropertyGrid height or width. By default, scrolling is enabled.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->scrollable(true);
?>

showDetails

Use this configuration to disable the ToggleDetails command button on the toolbar and to prevent the rendering of the Details/Info box.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value boolean

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->showDetails(true);
?>

addToolbarItem

Adds one or more PropertyGridToolbarItem to the PropertyGrid.

Returns

\Kendo\UI\PropertyGrid

Parameters

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

Example - using \Kendo\UI\PropertyGridToolbarItem

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$toolbarItem = new \Kendo\UI\PropertyGridToolbarItem();
$icon = 'value';
$toolbarItem->icon($icon);
$propertyGrid->addToolbarItem($toolbarItem);
?>

Example - using array

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$icon = 'value';
$propertyGrid->addToolbarItem(array('icon' => $icon));
?>

Example - adding more than one PropertyGridToolbarItem

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$first  = new \Kendo\UI\PropertyGridToolbarItem();
$second = new \Kendo\UI\PropertyGridToolbarItem();
$propertyGrid->addToolbarItem($first, $second);
?>

width

Sets the width of the PropertyGrid. Numeric values are treated as pixels.

Returns

\Kendo\UI\PropertyGrid

Parameters

$value float

Example

<?php
$propertyGrid = new \Kendo\UI\PropertyGrid('PropertyGrid');
$propertyGrid->width(1);
?>
In this article
Not finding the help you need?