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

data method - set data and total

2 Answers 1137 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Seyfor
Top achievements
Rank 1
Seyfor asked on 09 Sep 2016, 06:16 AM

I want to set data with data method(data), but I want to tell different total that is the size of array. Something like this:

dataSource.data({ data: this.asArray, total: this._rowCount});

How can I do that without setting transport option?

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 12 Sep 2016, 11:13 AM
Hello Matjaž,

The total number of the data can be set using only the schema.total property of the Kendo UI DataSource:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.total

Let me know if you need additional information on this matter.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Seyfor
Top achievements
Rank 1
answered on 16 Sep 2016, 01:29 PM

No it helps enough. Didn't think I can use schema -> total/data without transport. Thank you.

const o: kendo.data.DataSourceOptions = {
    pageSize: options.pageSize,     
    schema: {
        total: () =>
        {
            return this._rowCount;
        },
        data: () =>
        {
            return this.asArray;
             
        },
        model: this.getKendoModal()
    },
    page: 0,
    serverAggregates: true,
    serverFiltering: true,
    serverGrouping: true,
    serverPaging: true,
    serverSorting: true
};

Tags
Data Source
Asked by
Seyfor
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Seyfor
Top achievements
Rank 1
Share this question
or