1

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.

Yaser Moradi
  • 3,267
  • 3
  • 24
  • 50

3 Answers3

1

you can set it in the schema configuration,

        schema: {
            total: function (data) {
               return data.totalCount ;
            }
         }
Jayantha Lal Sirisena
  • 21,216
  • 11
  • 71
  • 92
1

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

Gabor Dolla
  • 2,680
  • 4
  • 14
  • 13
  • 1
    No, I was used to pass constructed simple object instead of kendo.data.dataSource class and it's working fine in lots of advanced scenarios in combo boxes and so on, but this time and in this specific scenario, it failed to work )-: – Yaser Moradi Nov 21 '13 at 17:19
0

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.

Yaser Moradi
  • 3,267
  • 3
  • 24
  • 50