Question

I've used JayData to load data from OData enabled asp.net web api within following query:

.withInlineCount().filter('it.IsArchived != true').orderBy('it.dVehicle_01').take(6)

As a result, I have an array of entities, that have a property named totalCount which is correct.

Then I'd like to set this results and it's total count for kendo pager datasource.

I could set data, but for totalCount I've tested a lot of options, but I couldn't figure it out.

My data grid should work with both offline and online databases so using kendo ui remote data source is not a suitable option for me.

Was it helpful?

Solution 3

I've tested a lot of options before, but within recent kendoUI api changes, we should get an instance of kendo.data.dataSource class instead of using old syntax to provide dataSource to pager.

OTHER TIPS

you can set it in the schema configuration,

        schema: {
            total: function (data) {
               return data.totalCount ;
            }
         }

you mean that it worked with the old version and stopped working with the recent version ? with the old version it just worked out of the box: http://jaydata.org/examples/KendoUI/Grid_ReadOnly

if you have to setup paging manually then see this example: http://jaydata.org/examples/KendoUI/ListView

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top