\Kendo\Data\DataSourceTransport
A PHP class representing the transport setting of DataSource.
Methods
batch
The object can contain all the available jQuery.ajax options.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value \Kendo\Data\DataSourceTransportBatch|array
Example - using \Kendo\Data\DataSourceTransportBatch
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$batch = new \Kendo\Data\DataSourceTransportBatch();
$url = 'value';
$batch->url($url);
$transport->batch($batch);
?>
Example - using array
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$url = 'value';
$transport->batch(array('url' => $url));
?>
cache
Specifies if the transport caches the result from read requests. The query parameters are used as a cache key and if the key is present in the cache, a new request to the server is not executed. The cache is kept in memory and, thus, cleared on page refresh.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value boolean
Example
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->cache(true);
?>
create
The configuration used when the data source saves newly created data items. Those are items added to the data source via the add or insert methods.If the value of transport.create is a function, the data source invokes that function instead of jQuery.ajax. Check the jQuery documentation for more details on the provided argument.If the value of transport.create is a string, the data source uses this string as the URL of the remote service.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\Data\DataSourceTransportCreate|array
Example - using string
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->create('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->create(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\Data\DataSourceTransportCreate
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$create = new \Kendo\Data\DataSourceTransportCreate();
$cache = true;
$create->cache($cache);
$transport->create($create);
?>
Example - using array
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$cache = true;
$transport->create(array('cache' => $cache));
?>
destroy
The configuration used when the data source destroys data items. Those are items removed from the data source via the remove method.If the value of transport.destroy is a function, the data source invokes that function instead of jQuery.ajax.If the value of transport.destroy is a string, the data source uses this string as the URL of the remote service.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\Data\DataSourceTransportDestroy|array
Example - using string
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->destroy('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->destroy(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\Data\DataSourceTransportDestroy
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$cache = true;
$destroy->cache($cache);
$transport->destroy($destroy);
?>
Example - using array
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$cache = true;
$transport->destroy(array('cache' => $cache));
?>
parameterMap
The function which converts the request parameters to a format suitable for the remote service. By default, the data source sends the parameters using jQuery conventions.If a transport.read.data function is used together with parameterMap, remember to preserve the result from the data function that will be received in the parameterMap arguments. An example is provided below. Generally, the parameterMap function is designed to transform the request payload, not to add new parameters to it.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value \Kendo\JavaScriptFunction
Example
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->parameterMap(new \Kendo\JavaScriptFunction('function() { }'));
?>
push
The function invoked during transport initialization which sets up push notifications. The data source will call this function only once and provide callbacks which will handle push notifications (data pushed from the server).
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value \Kendo\JavaScriptFunction
Example
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->push(new \Kendo\JavaScriptFunction('function() { }'));
?>
read
The configuration used when the data source loads data items from a remote service.If the value of transport.read is a function, the data source invokes that function instead of jQuery.ajax.If the value of transport.read is a string, the data source uses this string as the URL of the remote service.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\Data\DataSourceTransportRead|array
Example - using string
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\Data\DataSourceTransportRead
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$cache = true;
$read->cache($cache);
$transport->read($read);
?>
Example - using array
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$cache = true;
$transport->read(array('cache' => $cache));
?>
submit
A function that will handle create, update and delete operations in a single batch when custom transport is used, that is, the transport.read is defined as a function.The transport.create, transport.update, and transport.delete operations will not be executed in this case.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value \Kendo\JavaScriptFunction
Example
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->submit(new \Kendo\JavaScriptFunction('function() { }'));
?>
update
The configuration used when the data source saves updated data items. Those are data items whose fields have been updated.If the value of transport.update is a function, the data source invokes that function instead of jQuery.ajax.If the value of transport.update is a string, the data source uses this string as the URL of the remote service.
Returns
\Kendo\Data\DataSourceTransport
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\Data\DataSourceTransportUpdate|array
Example - using string
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->update('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$transport->update(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\Data\DataSourceTransportUpdate
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$update = new \Kendo\Data\DataSourceTransportUpdate();
$cache = true;
$update->cache($cache);
$transport->update($update);
?>
Example - using array
<?php
$transport = new \Kendo\Data\DataSourceTransport();
$cache = true;
$transport->update(array('cache' => $cache));
?>