\Kendo\UI\Grid

A PHP wrapper for Kendo UI Grid.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$grid->allowCopy(true)

// Output it

echo $grid->render();
?>

Methods

allowCopy

If set to true and selection of the Grid is enabled, the user could copy the selection into the clipboard and paste it into Excel or other similar programs that understand TSV/CSV formats. By default allowCopy is disabled and the default format is TSV. Can be set to a JavaScript object which represents the allowCopy configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->allowCopy(true);
?>

Example - using \Kendo\UI\GridAllowCopy

<?php
$grid = new \Kendo\UI\Grid('Grid');
$allowCopy = new \Kendo\UI\GridAllowCopy();
$delimeter = 'value';
$allowCopy->delimeter($delimeter);
$grid->allowCopy($allowCopy);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$delimeter = 'value';
$grid->allowCopy(array('delimeter' => $delimeter));
?>

allowPaste

If set to true and the selection functionality of the Grid is enabled, the user can paste the current textual content of the clipboard into the Grid.

Returns

\Kendo\UI\Grid

Parameters

$value boolean

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->allowPaste(true);
?>

altRowTemplate

The id of the template used for rendering the alternate rows in the grid.

Returns

\Kendo\UI\Grid

Parameters

$value string

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->altRowTemplate('value');
?>

autoBind

If set to false, the Grid will not bind to the data source during initialization, i.e. it will not call the fetch method of the dataSource instance. In such scenarios data binding will occur when the change event of the dataSource instance is fired. By default, autoBind is set to true and the widget will bind to the data source specified in the configuration.

Returns

\Kendo\UI\Grid

Parameters

$value boolean

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->autoBind(true);
?>

beforeEdit

Fired when the user tries to edit or create a data item, before the editor is created. Can be used to preventing editing according to any custom logic.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the beforeEdit event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

cancel

Fired when the user clicks the "cancel" button (in inline or popup editing mode) or closes the popup window.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the cancel event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

cellClose

Fired when "incell" edit mode is used and the cell is going to be closed. The event is triggerd after saving or canceling the changes, but before the cell is closed.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the cellClose event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

change

Fired when the user selects or deselects a table row or cell in the grid. To retrieve the selected elements, use the select method.The event handler function context (available via the this keyword) will be set to the widget instance.The event will be fired only when the Grid is selectable. For additional information check the change event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

changing

Fired when the user is about to select a table row or cell.The event will be fired only when the Grid is selectable. For additional information check the changing event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->changing('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChanging(e) {
        // handle the changing event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->changing('onChanging');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->changing(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnHide

Fired when the user hides a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnHide event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnHide('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnHide(e) {
        // handle the columnHide event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnHide('onColumnHide');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnHide(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnLock

Fired when the user lock a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnLock event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnLock('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnLock(e) {
        // handle the columnLock event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnLock('onColumnLock');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnLock(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnMenu

If set to true the grid will display the column menu when the user clicks the chevron icon in the column headers. The column menu allows the user to show and hide columns, filter and sort (if filtering and sorting are enabled). By default the column menu is not enabled.Can be set to a JavaScript object which represents the column menu configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenu(true);
?>

Example - using \Kendo\UI\GridColumnMenu

<?php
$grid = new \Kendo\UI\Grid('Grid');
$columnMenu = new \Kendo\UI\GridColumnMenu();
$autoSize = true;
$columnMenu->autoSize($autoSize);
$grid->columnMenu($columnMenu);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$autoSize = true;
$grid->columnMenu(array('autoSize' => $autoSize));
?>

columnMenuInit

Fired when the column menu is initialized.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnMenuInit event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuInit('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnMenuInit(e) {
        // handle the columnMenuInit event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuInit('onColumnMenuInit');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuInit(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnMenuOpen

Fired when the grid column menu is opened, after the animations are completed.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnMenuOpen event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuOpen('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnMenuOpen(e) {
        // handle the columnMenuOpen event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuOpen('onColumnMenuOpen');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnMenuOpen(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnReorder

Fired when the user changes the order of a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnReorder event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnReorder('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnReorder(e) {
        // handle the columnReorder event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnReorder('onColumnReorder');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnReorder(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnResize

Fired when the user resizes a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnResize event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

columnResizeHandleWidth

Defines the width of the column resize handle in pixels. Apply a larger value for easier grasping.

Returns

\Kendo\UI\Grid

Parameters

$value float

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnResizeHandleWidth(1);
?>

columnShow

Fired when the user shows a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnShow event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnShow('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnShow(e) {
        // handle the columnShow event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnShow('onColumnShow');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnShow(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnStick

Fired when the user sticks a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnStick event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnStick('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnStick(e) {
        // handle the columnStick event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnStick('onColumnStick');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnStick(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnUnlock

Fired when the user unlock a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnUnlock event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnlock('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnUnlock(e) {
        // handle the columnUnlock event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnlock('onColumnUnlock');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnlock(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnUnstick

Fired when the user unsticks a column.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the columnUnstick event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnstick('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onColumnUnstick(e) {
        // handle the columnUnstick event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnstick('onColumnUnstick');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->columnUnstick(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

addColumn

Adds one or more GridColumn to the Grid.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using \Kendo\UI\GridColumn

<?php
$grid = new \Kendo\UI\Grid('Grid');
$column = new \Kendo\UI\GridColumn();
$columnMenu = true;
$column->columnMenu($columnMenu);
$grid->addColumn($column);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$columnMenu = true;
$grid->addColumn(array('columnMenu' => $columnMenu));
?>

Example - adding more than one GridColumn

<?php
$grid = new \Kendo\UI\Grid('Grid');
$first  = new \Kendo\UI\GridColumn();
$second = new \Kendo\UI\GridColumn();
$grid->addColumn($first, $second);
?>

contextMenu

Configures the ContextMenus of the Grid.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\GridContextMenu

<?php
$grid = new \Kendo\UI\Grid('Grid');
$contextMenu = new \Kendo\UI\GridContextMenu();
$activate = new \Kendo\JavaScriptFunction('function() { }');
$contextMenu->activate($activate);
$grid->contextMenu($contextMenu);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$activate = new \Kendo\JavaScriptFunction('function() { }');
$grid->contextMenu(array('activate' => $activate));
?>

dataBinding

Fired before the widget binds to its data source.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the dataBinding event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

dataBound

Fired when the widget is bound to data from its data source.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the dataBound event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

dataSource

Sets the data source of the widget.

Returns

\Kendo\UI\Grid

Parameters

$value \Kendo\Data\DataSource|array

Example - using \Kendo\Data\DataSource

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

Example - using array

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

detailCollapse

Fired when the user collapses a detail table row.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the detailCollapse event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailCollapse('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDetailCollapse(e) {
        // handle the detailCollapse event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailCollapse('onDetailCollapse');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailCollapse(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

detailExpand

Fired when the user expands a detail table row.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the detailExpand event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailExpand('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDetailExpand(e) {
        // handle the detailExpand event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailExpand('onDetailExpand');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailExpand(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

detailInit

Fired when a detail table row is initialized.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the detailInit event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailInit('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onDetailInit(e) {
        // handle the detailInit event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailInit('onDetailInit');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailInit(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

detailTemplate

The id of the template used for rendering the detail rows in the grid.

Returns

\Kendo\UI\Grid

Parameters

$value string

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->detailTemplate('value');
?>

edit

Fired when the user edits or creates a data item.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the edit event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

editable

If set to true the user would be able to edit the data to which the grid is bound. By default editing is disabled.Can be set to a string ("inline", "incell" or "popup") to specify the editing mode. The default editing mode is "incell".Can be set to a JavaScript object which represents the editing configuration.

Returns

\Kendo\UI\Grid

Parameters

$value boolean|string|\Kendo\UI\GridEditable|array

Example - using boolean

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

Example - using string

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->editable('value');
?>

Example - using \Kendo\UI\GridEditable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$editable = new \Kendo\UI\GridEditable();
$cancelDelete = 'value';
$editable->cancelDelete($cancelDelete);
$grid->editable($editable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$cancelDelete = 'value';
$grid->editable(array('cancelDelete' => $cancelDelete));
?>

encodeTitles

If set to true the column title will be HTML-encoded before it is displayed. If set to false the column title will be displayed as is.

Returns

\Kendo\UI\Grid

Parameters

$value boolean

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->encodeTitles(true);
?>

excel

Configures the Kendo UI Grid Excel export settings.

Returns

\Kendo\UI\Grid

Parameters

$value \Kendo\UI\GridExcel|array

Example - using \Kendo\UI\GridExcel

<?php
$grid = new \Kendo\UI\Grid('Grid');
$excel = new \Kendo\UI\GridExcel();
$allPages = true;
$excel->allPages($allPages);
$grid->excel($excel);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$allPages = true;
$grid->excel(array('allPages' => $allPages));
?>

excelExport

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

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

filter

Fired when the user is about to filter the DataSource via the filter UI.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2016 R3 (2016.3.914) release. For additional information check the filter event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filter('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onFilter(e) {
        // handle the filter event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filter('onFilter');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filter(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

filterMenuInit

Fired when the grid filter menu is initialized, when it is opened for the first time.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the filterMenuInit event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuInit('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onFilterMenuInit(e) {
        // handle the filterMenuInit event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuInit('onFilterMenuInit');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuInit(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

filterMenuOpen

Fired when the grid filter menu is opened, after the animations are completed.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the filterMenuOpen event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuOpen('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onFilterMenuOpen(e) {
        // handle the filterMenuOpen event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuOpen('onFilterMenuOpen');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterMenuOpen(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

filterable

If set to true the user can filter the data source using the grid filter menu. Filtering is disabled by default.Can be set to a JavaScript object which represents the filter menu configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->filterable(true);
?>

Example - using \Kendo\UI\GridFilterable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$filterable = new \Kendo\UI\GridFilterable();
$extra = true;
$filterable->extra($extra);
$grid->filterable($filterable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$extra = true;
$grid->filterable(array('extra' => $extra));
?>

group

Fired when the user is about to group the DataSource or modify the group descriptors state via the Grid group panel.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2016 R3 (2016.3.914) release. For additional information check the group event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->group('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onGroup(e) {
        // handle the group event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->group('onGroup');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->group(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

groupCollapse

Fired when the user collapses a group row.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2017 R3 (2017.3.913) release. For additional information check the groupCollapse event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

groupExpand

Fired when the user expands a group row.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2017 R3 (2017.3.913) release. For additional information check the groupExpand event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

groupable

If set to true the user could group the grid by dragging the column header cells. By default grouping is disabled.Can be set to a JavaScript object which represents the grouping configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\GridGroupable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$groupable = new \Kendo\UI\GridGroupable();
$enabled = true;
$groupable->enabled($enabled);
$grid->groupable($groupable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$enabled = true;
$grid->groupable(array('enabled' => $enabled));
?>

height

The height of the grid. Numeric values are treated as pixels.When string is used the format can be "number" + "px" or "number" alone. For example: "100px" or "100".

Returns

\Kendo\UI\Grid

Parameters

$value float|string

Example - using float

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

Example - using string

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->height('value');
?>

loaderType

Defines what loader will be used while loading the data. Possible values are: "loadingPanel" - a panel with a circular loading indicator. or "skeleton" - a skeleton enabled loader..

Returns

\Kendo\UI\Grid

Parameters

$value string

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->loaderType('value');
?>

messages

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

Returns

\Kendo\UI\Grid

Parameters

$value \Kendo\UI\GridMessages|array

Example - using \Kendo\UI\GridMessages

<?php
$grid = new \Kendo\UI\Grid('Grid');
$messages = new \Kendo\UI\GridMessages();
$expandCollapseColumnHeader = 'value';
$messages->expandCollapseColumnHeader($expandCollapseColumnHeader);
$grid->messages($messages);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$expandCollapseColumnHeader = 'value';
$grid->messages(array('expandCollapseColumnHeader' => $expandCollapseColumnHeader));
?>

mobile

If set to true and the grid is viewed on mobile browser it will use adaptive rendering.Can be set to a string phone which will force the widget to use adaptive rendering regardless of browser type.

Returns

\Kendo\UI\Grid

Parameters

$value boolean|string

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->mobile(true);
?>

Example - using string

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->mobile('value');
?>

If set to true the user could navigate the component using the keyboard navigation. By default keyboard navigation is disabled.

Returns

\Kendo\UI\Grid

Parameters

$value boolean

Example

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

Fired when navigatable is enabled and the user change current item with either mouse or keyboard interaction.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the navigate event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->navigate('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onNavigate(e) {
        // handle the navigate event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->navigate('onNavigate');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->navigate(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

noRecords

If set to true and current view contains no records, message similar to "No records available" will be displayed. By default this option is disabled.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->noRecords(true);
?>

Example - using \Kendo\UI\GridNoRecords

<?php
$grid = new \Kendo\UI\Grid('Grid');
$noRecords = new \Kendo\UI\GridNoRecords();
$template = 'value';
$noRecords->template($template);
$grid->noRecords($noRecords);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$template = 'value';
$grid->noRecords(array('template' => $template));
?>

page

Fired when the user is about change the current page index of DataSource via the pager UI.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2016 R3 (2016.3.914) release. For additional information check the page event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->page('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onPage(e) {
        // handle the page event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->page('onPage');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->page(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

pageable

If set to true the grid will display a pager. By default paging is disabled.Can be set to a JavaScript object which represents the pager configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->pageable(true);
?>

Example - using \Kendo\UI\GridPageable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$pageable = new \Kendo\UI\GridPageable();
$alwaysVisible = true;
$pageable->alwaysVisible($alwaysVisible);
$grid->pageable($pageable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$alwaysVisible = true;
$grid->pageable(array('alwaysVisible' => $alwaysVisible));
?>

paste

Fired when the user pastes data using the Grid's built-in paste mechanism.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the paste event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->paste('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onPaste(e) {
        // handle the paste event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->paste('onPaste');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->paste(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

pdf

Configures the Kendo UI Grid PDF export settings.

Returns

\Kendo\UI\Grid

Parameters

$value \Kendo\UI\GridPdf|array

Example - using \Kendo\UI\GridPdf

<?php
$grid = new \Kendo\UI\Grid('Grid');
$pdf = new \Kendo\UI\GridPdf();
$allPages = true;
$pdf->allPages($allPages);
$grid->pdf($pdf);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$allPages = true;
$grid->pdf(array('allPages' => $allPages));
?>

pdfExport

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

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

persistSelection

Sets a value indicating whether the selection will be persisted when sorting, paging, filtering and etc are performed.

Returns

\Kendo\UI\Grid

Parameters

$value boolean

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->persistSelection(true);
?>

remove

Fired when the user clicks the "destroy" command button and delete operation is confirmed in the confirmation window, if the cancel button in the window is clicked the event will not be fired.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the remove event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->remove('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onRemove(e) {
        // handle the remove event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->remove('onRemove');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->remove(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

reorderable

If set to true the user could reorder the columns by dragging their header cells. By default reordering is disabled. Multi-level headers allow reordering only in same level.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->reorderable(true);
?>

Example - using \Kendo\UI\GridReorderable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$reorderable = new \Kendo\UI\GridReorderable();
$columns = true;
$reorderable->columns($columns);
$grid->reorderable($reorderable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$columns = true;
$grid->reorderable(array('columns' => $columns));
?>

resizable

If object is used, it allows configuration of resizable.columns and resizable.rows. If set to true, only column resizing will be enabled.By default, column and row resizing is disabled.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\GridResizable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$resizable = new \Kendo\UI\GridResizable();
$columns = true;
$resizable->columns($columns);
$grid->resizable($resizable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$columns = true;
$grid->resizable(array('columns' => $columns));
?>

rowReorder

Fired when the user changes the order of a row.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the rowReorder event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowReorder('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onRowReorder(e) {
        // handle the rowReorder event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowReorder('onRowReorder');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowReorder(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

rowResize

Fired when the user resizes a row (rows).The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the rowResize event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowResize('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onRowResize(e) {
        // handle the rowResize event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowResize('onRowResize');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowResize(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

rowTemplate

The id of the template used for rendering the rows in the grid.

Returns

\Kendo\UI\Grid

Parameters

$value string

Example

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->rowTemplate('value');
?>

save

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

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

saveChanges

Fired when the user clicks the "save" command button.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the saveChanges event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->saveChanges('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSaveChanges(e) {
        // handle the saveChanges event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->saveChanges('onSaveChanges');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->saveChanges(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

scrollable

If set to true the grid will display a scrollbar when the total row height (or width) exceeds the grid height (or width). By default scrolling is enabled.Can be set to a JavaScript object which represents the scrolling configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\GridScrollable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$scrollable = new \Kendo\UI\GridScrollable();
$endless = true;
$scrollable->endless($endless);
$grid->scrollable($scrollable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$endless = true;
$grid->scrollable(array('endless' => $endless));
?>

Configures the Kendo UI Grid search bar settings.

Returns

\Kendo\UI\Grid

Parameters

$value \Kendo\UI\GridSearch|array

Example - using \Kendo\UI\GridSearch

<?php
$grid = new \Kendo\UI\Grid('Grid');
$search = new \Kendo\UI\GridSearch();
$fields = new \Kendo\UI\GridSearchFields();
$search->fields($fields);
$grid->search($search);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$fields = new \Kendo\UI\GridSearchFields();
$grid->search(array('fields' => $fields));
?>

selectable

If set to true the user would be able to select grid rows. By default selection is disabled.Can also be set to the following string values: "row" - the user can select a single row.; "cell" - the user can select a single cell.; "multiple, row" - the user can select multiple rows. or "multiple, cell" - the user can select multiple cells..

Returns

\Kendo\UI\Grid

Parameters

$value boolean|string|\Kendo\UI\GridSelectable|array

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->selectable(true);
?>

Example - using string

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->selectable('value');
?>

Example - using \Kendo\UI\GridSelectable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$selectable = new \Kendo\UI\GridSelectable();
$cellAggregates = true;
$selectable->cellAggregates($cellAggregates);
$grid->selectable($selectable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$cellAggregates = true;
$grid->selectable(array('cellAggregates' => $cellAggregates));
?>

size

Sets a value controlling size of the component. Can also be set to the following string values: "small"; "medium" or "large".

Returns

\Kendo\UI\Grid

Parameters

$value string

Example

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

sort

Fired when the user is about to modify the current state of sort descriptors of DataSource via the sort UI.The event handler function context (available via the this keyword) will be set to the widget instance.Introduced in the Kendo UI 2016 R3 (2016.3.914) release. For additional information check the sort event documentation.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->sort('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSort(e) {
        // handle the sort event.
    }
</script>
<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->sort('onSort');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->sort(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

sortable

If set to true the user could sort the grid by clicking the column header cells. By default sorting is disabled.Can be set to a JavaScript object which represents the sorting configuration.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using boolean

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->sortable(true);
?>

Example - using \Kendo\UI\GridSortable

<?php
$grid = new \Kendo\UI\Grid('Grid');
$sortable = new \Kendo\UI\GridSortable();
$allowUnsort = true;
$sortable->allowUnsort($allowUnsort);
$grid->sortable($sortable);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$allowUnsort = true;
$grid->sortable(array('allowUnsort' => $allowUnsort));
?>

statusBarTemplate

The template which renders the Status Bar/Aggregates Bar.

Returns

\Kendo\UI\Grid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->statusBarTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->statusBarTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

addToolbarItem

Adds one or more GridToolbarItem to the Grid.

Returns

\Kendo\UI\Grid

Parameters

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

Example - using \Kendo\UI\GridToolbarItem

<?php
$grid = new \Kendo\UI\Grid('Grid');
$toolbarItem = new \Kendo\UI\GridToolbarItem();
$iconClass = 'value';
$toolbarItem->iconClass($iconClass);
$grid->addToolbarItem($toolbarItem);
?>

Example - using array

<?php
$grid = new \Kendo\UI\Grid('Grid');
$iconClass = 'value';
$grid->addToolbarItem(array('iconClass' => $iconClass));
?>

Example - adding more than one GridToolbarItem

<?php
$grid = new \Kendo\UI\Grid('Grid');
$first  = new \Kendo\UI\GridToolbarItem();
$second = new \Kendo\UI\GridToolbarItem();
$grid->addToolbarItem($first, $second);
?>

width

The width of the grid. Numeric values are treated as pixels.

Returns

\Kendo\UI\Grid

Parameters

$value float|string

Example - using float

<?php
$grid = new \Kendo\UI\Grid('Grid');
$grid->width(1);
?>

Example - using string

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