\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

autoBind

If set to false the widget will not bind to the DataSource during initialization.Applicable only in data bound mode.

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 user scrolls to next page. Higher values will 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 widget 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 milliseconds that take the ScrollView to snap to the current page after released.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

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

emptyTemplate

The template which is used to render the pages without content. By default the ScrollView renders a blank page.Applicable only in data bound mode.

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 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);
?>

page

The initial page to display.

Returns

\Kendo\UI\ScrollView

Parameters

$value float

Example

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

refresh

Fires when widget 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 which is used to render the content of pages. By default the ScrollView renders a div element for every page.Applicable only in data bound mode.

Returns

\Kendo\UI\ScrollView

Parameters

$value string

Example

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

velocityThreshold

The length of horizotal swipe after which a swipe will navigate to the next page (as opposed to snapping back to the current page). Higher values will require long area swipe in order 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?