문제

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.

도움이 되었습니까?

해결책 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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top