This is a migrated thread and some comments may be shown as answers.

Batch Read

2 Answers 79 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Collin
Top achievements
Rank 2
Collin asked on 09 Jul 2013, 04:08 PM
Hi, I'm trying to use the batch CRUD feature. However, it appears to be ignored for reads. I want it to batch up filter() and sort() calls, then execute them with one sync() call. Is this possible?

var dataSource = new kendo.data.DataSource({
batch: true,
        transport: {
            read: {
                url: '/api/v1/items',
                type: 'GET',
                dataType: 'json'
            }
        },
serverPaging: true,
pageSize: 1,
serverSorting: true,
serverFiltering: true,
serverGrouping: true,
etc...

Then I'd like to call dataSource.filter(), dataSource.sort(), etc. with a final dataSource.sync() at the end to run the final query. Currently this is not working.

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 11 Jul 2013, 08:12 AM
Hello Collin,

 The batch option is supported only for create, update and destroy operations. If you want to perform both filter and sort in the same request you could use the query method of the data source and provide both sort and filter options.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Collin
Top achievements
Rank 2
answered on 11 Jul 2013, 12:47 PM
Thanks. The API docs should be changed then as they are misleading:

batch Boolean(default: false)
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.
Tags
Data Source
Asked by
Collin
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Collin
Top achievements
Rank 2
Share this question
or