<kendo:dataSource>

A JSP wrapper for Kendo UI DataSource.

Configuration Attributes

autoSync boolean

If set to true the data source would automatically save any changed data items by calling the sync method. By default, changes are not automatically saved.

Example

<kendo:dataSource autoSync="autoSync">
</kendo:dataSource>

batch boolean

If set to true, the data source will batch CRUD operation requests. For example, updating two data items would cause one HTTP request instead of two. By default, the data source makes a HTTP request for every CRUD operation.

Example

<kendo:dataSource batch="batch">
</kendo:dataSource>

data java.lang.Object

The array of data items which the data source contains. The data source will wrap those items as kendo.data.ObservableObject or kendo.data.Model (if schema.model is set).Can be set to a string value if the schema.type option is set to "xml".

Example

<kendo:dataSource data="data">
</kendo:dataSource>

inPlaceSort boolean

If set to true the original Array used as data will be sorted when sorting operation is performed. This setting supported only with local data, bound to a JavaScript array via the data option.

Example

<kendo:dataSource inPlaceSort="inPlaceSort">
</kendo:dataSource>

offlineStorage java.lang.Object

The offline storage key or custom offline storage implementation.

Example

<kendo:dataSource offlineStorage="offlineStorage">
</kendo:dataSource>

page float

The page of data which the data source will return when the view method is invoked or request from the remote service.

Example

<kendo:dataSource page="page">
</kendo:dataSource>

pageSize float

The number of data items per page. The property has no default value. That is why to use paging, make sure some pageSize value is set.

Example

<kendo:dataSource pageSize="pageSize">
</kendo:dataSource>

serverAggregates boolean

If set to true, the data source will leave the aggregate calculation to the remote service. By default, the data source calculates aggregates client-side.For more information and tips about client and server data operations, refer to the introductory article on the DataSource.

Example

<kendo:dataSource serverAggregates="serverAggregates">
</kendo:dataSource>

serverFiltering boolean

If set to true, the data source will leave the filtering implementation to the remote service. By default, the data source performs filtering client-side.By default, the filter is sent to the server following jQuery's conventions.For example, the filter { logic: "and", filters: [ { field: "name", operator: "startswith", value: "Jane" } ] } is sent as: filter[logic]: and; filter[filters][0][field]: name; filter[filters][0][operator]: startswith or filter[filters][0][value]: Jane. Use the parameterMap option to send the filter option in a different format.For more information and tips about client and server data operations, refer to the introductory article on the DataSource.

Example

<kendo:dataSource serverFiltering="serverFiltering">
</kendo:dataSource>

serverGrouping boolean

If set to true, the data source will leave the grouping implementation to the remote service. By default, the data source performs grouping client-side.By default, the group is sent to the server following jQuery's conventions.For example, the group { field: "category", dir: "desc" } is sent as: group[0][field]: category or group[0][dir]: desc. Use the parameterMap option to send the group option in a different format.For more information and tips about client and server data operations, refer to the introductory article on the DataSource.

Example

<kendo:dataSource serverGrouping="serverGrouping">
</kendo:dataSource>

serverPaging boolean

If set to true, the data source will leave the data item paging implementation to the remote service. By default, the data source performs paging client-side.The following options are sent to the server when server paging is enabled: page - the page of data item to return (1 means the first page).; pageSize - the number of items to return.; skip - how many data items to skip. or take - the number of data items to return (the same as pageSize).. Use the parameterMap option to send the paging options in a different format.For more information and tips about client and server data operations, refer to the introductory article on the DataSource.

Example

<kendo:dataSource serverPaging="serverPaging">
</kendo:dataSource>

serverSorting boolean

If set to true, the data source will leave the data item sorting implementation to the remote service. By default, the data source performs sorting client-side.By default, the sort is sent to the server following jQuery's conventions.For example, the sort { field: "age", dir: "desc" } is sent as: sort[0][field]: age or sort[0][dir]: desc. Use the parameterMap option to send the paging options in a different format.For more information and tips about client and server data operations, refer to the introductory article on the DataSource.

Example

<kendo:dataSource serverSorting="serverSorting">
</kendo:dataSource>

type java.lang.String

If set, the data source will use a predefined transport and/or schema.The supported values are: "odata" which supports the OData v.2 protocol; "odata-v4" which partially supports odata version 4 or "signalr".

Example

<kendo:dataSource type="type">
</kendo:dataSource>

Configuration JSP Tags

kendo:dataSource-aggregate

The aggregates which are calculated when the data source populates with data.The supported aggregates are: "average" - Only for Number.; "count" - String, Number and Date.; "max" - Number and Date.; "min" - Number and Date. or "sum" - Only for Number..

More documentation is available at kendo:dataSource-aggregate.

Example

<kendo:dataSource>
    <kendo:dataSource-aggregate></kendo:dataSource-aggregate>
</kendo:dataSource>

kendo:dataSource-filter

The filters which are applied over the data items. By default, no filter is applied.

More documentation is available at kendo:dataSource-filter.

Example

<kendo:dataSource>
    <kendo:dataSource-filter></kendo:dataSource-filter>
</kendo:dataSource>

kendo:dataSource-group

The grouping configuration of the data source. If set, the data items will be grouped when the data source is populated. By default, grouping is not applied.

More documentation is available at kendo:dataSource-group.

Example

<kendo:dataSource>
    <kendo:dataSource-group></kendo:dataSource-group>
</kendo:dataSource>

kendo:dataSource-schema

The configuration used to parse the remote service response.

More documentation is available at kendo:dataSource-schema.

Example

<kendo:dataSource>
    <kendo:dataSource-schema></kendo:dataSource-schema>
</kendo:dataSource>

kendo:dataSource-sort

The sort order which will be applied over the data items. By default the data items are not sorted.

More documentation is available at kendo:dataSource-sort.

Example

<kendo:dataSource>
    <kendo:dataSource-sort></kendo:dataSource-sort>
</kendo:dataSource>

kendo:dataSource-transport

The configuration used to load and save the data items. A data source is remote or local based on the way of it retrieves data items.Remote data sources load and save data items from and to a remote end-point (also known as remote service or server). The transport option describes the remote service configuration - URL, HTTP verb, HTTP headers, and others. The transport option can also be used to implement custom data loading and saving.Local data sources are bound to a JavaScript array via the data option.

More documentation is available at kendo:dataSource-transport.

Example

<kendo:dataSource>
    <kendo:dataSource-transport></kendo:dataSource-transport>
</kendo:dataSource>

Event Attributes

change String

Fired when the data source is populated from a JavaScript array or a remote service, a data item is inserted, updated or removed, the data items are paged, sorted, filtered, or grouped.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the change event documentation.

Example

<kendo:dataSource change="handle_change">
</kendo:dataSource>
<script>
    function handle_change(e) {
        // Code to handle the change event.
    }
</script>

error String

Fired when a request to the remote service fails.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the error event documentation.

Example

<kendo:dataSource error="handle_error">
</kendo:dataSource>
<script>
    function handle_error(e) {
        // Code to handle the error event.
    }
</script>

push String

Fired when the data source receives a push notification or the pushCreate, pushUpdate, or pushDestroy methods are called.

For additional information check the push event documentation.

Example

<kendo:dataSource push="handle_push">
</kendo:dataSource>
<script>
    function handle_push(e) {
        // Code to handle the push event.
    }
</script>

requestEnd String

Fired when a remote service request is finished.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the requestEnd event documentation.

Example

<kendo:dataSource requestEnd="handle_requestEnd">
</kendo:dataSource>
<script>
    function handle_requestEnd(e) {
        // Code to handle the requestEnd event.
    }
</script>

requestStart String

Fired when the data source makes a remote service request.The event handler function context (available via the this keyword) will be set to the data source instance.It is possible to prevent the remote request. To achieve this, execute e.preventDefault() in the handler function.

For additional information check the requestStart event documentation.

Example

<kendo:dataSource requestStart="handle_requestStart">
</kendo:dataSource>
<script>
    function handle_requestStart(e) {
        // Code to handle the requestStart event.
    }
</script>

sync String

Fired after the data source saves data item changes. The data source saves the data item changes when the sync method is called.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the sync event documentation.

Example

<kendo:dataSource sync="handle_sync">
</kendo:dataSource>
<script>
    function handle_sync(e) {
        // Code to handle the sync event.
    }
</script>

Event Tags

kendo:dataSource-change

Fired when the data source is populated from a JavaScript array or a remote service, a data item is inserted, updated or removed, the data items are paged, sorted, filtered, or grouped.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the change event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-change>
        <script>
            function(e) {
                // Code to handle the change event.
            }
        </script>
    </kendo:dataSource-change>
</kendo:dataSource>

kendo:dataSource-error

Fired when a request to the remote service fails.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the error event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-error>
        <script>
            function(e) {
                // Code to handle the error event.
            }
        </script>
    </kendo:dataSource-error>
</kendo:dataSource>

kendo:dataSource-push

Fired when the data source receives a push notification or the pushCreate, pushUpdate, or pushDestroy methods are called.

For additional information check the push event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-push>
        <script>
            function(e) {
                // Code to handle the push event.
            }
        </script>
    </kendo:dataSource-push>
</kendo:dataSource>

kendo:dataSource-requestEnd

Fired when a remote service request is finished.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the requestEnd event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-requestEnd>
        <script>
            function(e) {
                // Code to handle the requestEnd event.
            }
        </script>
    </kendo:dataSource-requestEnd>
</kendo:dataSource>

kendo:dataSource-requestStart

Fired when the data source makes a remote service request.The event handler function context (available via the this keyword) will be set to the data source instance.It is possible to prevent the remote request. To achieve this, execute e.preventDefault() in the handler function.

For additional information check the requestStart event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-requestStart>
        <script>
            function(e) {
                // Code to handle the requestStart event.
            }
        </script>
    </kendo:dataSource-requestStart>
</kendo:dataSource>

kendo:dataSource-sync

Fired after the data source saves data item changes. The data source saves the data item changes when the sync method is called.The event handler function context (available via the this keyword) will be set to the data source instance.

For additional information check the sync event documentation.

Example

<kendo:dataSource>
    <kendo:dataSource-sync>
        <script>
            function(e) {
                // Code to handle the sync event.
            }
        </script>
    </kendo:dataSource-sync>
</kendo:dataSource>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy