\Kendo\UI\PivotGrid

A PHP wrapper for Kendo UI PivotGrid.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$pivotGrid->autoBind(true)

// Output it

echo $pivotGrid->render();
?>

Methods

autoBind

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

Returns

\Kendo\UI\PivotGrid

Parameters

$value boolean

Example

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

collapseMember

Fired before column or row field is collapsed.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the collapseMember event documentation.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->collapseMember('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onCollapseMember(e) {
        // handle the collapseMember event.
    }
</script>
<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->collapseMember('onCollapseMember');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->collapseMember(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

columnHeaderTemplate

The template which renders the content of the column header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding column header cell or tuple - the tuple of the corresponding column header cell. For information about the tuple structure check this link.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->columnHeaderTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->columnHeaderTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

columnWidth

The width of the table columns. Value is treated as pixels.

Returns

\Kendo\UI\PivotGrid

Parameters

$value float

Example

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->columnWidth(1);
?>

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\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

dataBound

Fired after the widget is bound to the 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\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

dataCellTemplate

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.The fields which can be used in the template are: columnTuple - the tuple of the corresponding column header cell; rowTuple - the tuple of the corresponding row header cell; measure - the value of the data cell measure or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->dataCellTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->dataCellTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

dataSource

Sets the data source of the widget.

Returns

\Kendo\UI\PivotGrid

Parameters

$value \Kendo\Data\DataSource|array

Example - using \Kendo\Data\DataSource

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

Example - using array

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

excel

Configures the Kendo UI PivotGrid Excel export settings.

Returns

\Kendo\UI\PivotGrid

Parameters

$value \Kendo\UI\PivotGridExcel|array

Example - using \Kendo\UI\PivotGridExcel

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$excel = new \Kendo\UI\PivotGridExcel();
$fileName = 'value';
$excel->fileName($fileName);
$pivotGrid->excel($excel);
?>

Example - using array

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

excelExport

Fired when saveAsExcel method is called. For additional information check the excelExport event documentation.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

expandMember

Fired before column or row field is expanded.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the expandMember event documentation.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->expandMember('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onExpandMember(e) {
        // handle the expandMember event.
    }
</script>
<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->expandMember('onExpandMember');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->expandMember(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

filterable

If set to true the user will be able to filter by using the field menu.

Returns

\Kendo\UI\PivotGrid

Parameters

$value boolean

Example

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

height

The height of the PivotGrid. Numeric values are treated as pixels.

Returns

\Kendo\UI\PivotGrid

Parameters

$value float|string

Example - using float

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

Example - using string

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

kpiStatusTemplate

The template which renders the content of the KPI Status value. By default renders "open", "hold" and "denied" status icons.The fields which can be used in the template are: columnTuple - the tuple of the corresponding column header cell; rowTuple - the tuple of the corresponding row header cell; measure - the value of the data cell measure or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->kpiStatusTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->kpiStatusTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

kpiTrendTemplate

The template which renders the content of the KPI Trend value. By default renders "increase", "decrease" and "equal" status icons.The fields which can be used in the template are: columnTuple - the tuple of the corresponding column header cell; rowTuple - the tuple of the corresponding row header cell; measure - the value of the data cell measure or dataItem - the data item itself. For information about the tuple structure check this link. About the data item structure review this help topic.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->kpiTrendTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->kpiTrendTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

messages

The text messages displayed in the fields sections.

Returns

\Kendo\UI\PivotGrid

Parameters

$value \Kendo\UI\PivotGridMessages|array

Example - using \Kendo\UI\PivotGridMessages

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$messages = new \Kendo\UI\PivotGridMessages();
$columnFields = 'value';
$messages->columnFields($columnFields);
$pivotGrid->messages($messages);
?>

Example - using array

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$columnFields = 'value';
$pivotGrid->messages(array('columnFields' => $columnFields));
?>

pdf

Configures the Kendo UI PivotGrid PDF export settings.

Returns

\Kendo\UI\PivotGrid

Parameters

$value \Kendo\UI\PivotGridPdf|array

Example - using \Kendo\UI\PivotGridPdf

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pdf = new \Kendo\UI\PivotGridPdf();
$author = 'value';
$pdf->author($author);
$pivotGrid->pdf($pdf);
?>

Example - using array

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

pdfExport

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

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

reorderable

If set to false the user will not be able to add/close/reorder current fields for columns/rows/measures.

Returns

\Kendo\UI\PivotGrid

Parameters

$value boolean

Example

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

rowHeaderTemplate

The template which renders the content of the row header cell. By default it renders the caption of the tuple member.The fields which can be used in the template are: member - the member of the corresponding row header cell or tuple - the tuple of the corresponding row header cell. For information about the tuple structure check this link.

Returns

\Kendo\UI\PivotGrid

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->rowHeaderTemplate('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$pivotGrid->rowHeaderTemplate(new \Kendo\JavaScriptFunction('function() { }'));
?>

sortable

If set to true the user could sort the pivotgrid by clicking the dimension fields. By default sorting is disabled.Can be set to a JavaScript object which represents the sorting configuration.

Returns

\Kendo\UI\PivotGrid

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\PivotGridSortable

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$sortable = new \Kendo\UI\PivotGridSortable();
$allowUnsort = true;
$sortable->allowUnsort($allowUnsort);
$pivotGrid->sortable($sortable);
?>

Example - using array

<?php
$pivotGrid = new \Kendo\UI\PivotGrid('PivotGrid');
$allowUnsort = true;
$pivotGrid->sortable(array('allowUnsort' => $allowUnsort));
?>
In this article
Not finding the help you need?