\Kendo\UI\ScrollView

A PHP wrapper for Kendo UI ScrollView.

Inherits from \Kendo\UI\Widget.

Usage

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

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

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

// Output it

echo $scrollView->render();
?>

Methods

ARIATemplate

Specifies a template is used to populate an aria-live element that anounces which is the current item.

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->ARIATemplate('value');
?>

autoBind

If set to false the widget will not bind to the DataSource during initialization.

Returns

\Kendo\UI\ScrollView

Parameters

$value boolean

Example

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

bounceVelocityThreshold

The intensity of the swipe after which the swipe will result in a bounce effect when the user scrolls to the next page. Higher values require more accelerative swipe to notice the bounce effect when a page is changed.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->bounceVelocityThreshold(1);
?>

change

Fires when the ScrollView page is changed. For additional information check the change event documentation.

Returns

\Kendo\UI\ScrollView

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

contentHeight

The height of the ScrollView content.

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->contentHeight('value');
?>

dataSource

Sets the data source of the widget.

Returns

\Kendo\UI\ScrollView

Parameters

$value \Kendo\Data\DataSource|array

Example - using \Kendo\Data\DataSource

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

Example - using array

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

duration

The duration (in milliseconds) for the ScrollView to snap to the current page after the user releases it.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->duration(1);
?>

emptyTemplate

The template for rendering the pages without content. By default, the ScrollView renders a blank page.

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->emptyTemplate('value');
?>

enablePager

If set to true, the ScrollView will display a pager. By default, the pager is enabled.

Returns

\Kendo\UI\ScrollView

Parameters

$value boolean

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->enablePager(true);
?>

addItem

Adds one or more ScrollViewItem to the ScrollView.

Returns

\Kendo\UI\ScrollView

Parameters

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

Example - using \Kendo\UI\ScrollViewItem

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$item = new \Kendo\UI\ScrollViewItem();
$content = 'value';
$item->content($content);
$scrollView->addItem($item);
?>

Example - using array

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$content = 'value';
$scrollView->addItem(array('content' => $content));
?>

Example - adding more than one ScrollViewItem

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$first  = new \Kendo\UI\ScrollViewItem();
$second = new \Kendo\UI\ScrollViewItem();
$scrollView->addItem($first, $second);
?>

messages

Defines the messages that are set as aria-lables for the previous and next buttons.

Returns

\Kendo\UI\ScrollView

Parameters

$value \Kendo\UI\ScrollViewMessages|array

Example - using \Kendo\UI\ScrollViewMessages

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$messages = new \Kendo\UI\ScrollViewMessages();
$nextButtonLabel = 'value';
$messages->nextButtonLabel($nextButtonLabel);
$scrollView->messages($messages);
?>

Example - using array

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$nextButtonLabel = 'value';
$scrollView->messages(array('nextButtonLabel' => $nextButtonLabel));
?>

If set to true enables the built-in keyboard navigation

Returns

\Kendo\UI\ScrollView

Parameters

$value boolean

Example

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

page

The initial page that will be displayed.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->page(1);
?>

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

Parameters

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

Example - using boolean

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

Example - using \Kendo\UI\ScrollViewPageable

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$pageable = new \Kendo\UI\ScrollViewPageable();
$aRIATemplate = 'value';
$pageable->ARIATemplate($aRIATemplate);
$scrollView->pageable($pageable);
?>

Example - using array

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$aRIATemplate = 'value';
$scrollView->pageable(array('ARIATemplate' => $aRIATemplate));
?>

pagerOverlay

Sets an overlay background color for the pager. It can be configured to one of the three possible values: - none - no background overlay is set - dark - sets a dark-colored background overlay - light - sets a light-colored background overlay

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->pagerOverlay('value');
?>

refresh

Fires when the ScrollView refreshes. For additional information check the refresh event documentation.

Returns

\Kendo\UI\ScrollView

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->refresh('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onRefresh(e) {
        // handle the refresh event.
    }
</script>
<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->refresh('onRefresh');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->refresh(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

template

The template for rendering the content of the pages. By default, the ScrollView renders a div element for every page.

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

<?php
$scrollView = new \Kendo\UI\ScrollView('ScrollView');
$scrollView->template('value');
?>

velocityThreshold

The length of the horizontal swipe after which a swipe will navigate to the next page - as opposed to snapping back to the current page. Higher values require long area swipes to navigate to the next page.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

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