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

Binding Grid to external dataSource (i.e. uphsot)

2 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Szilard
Top achievements
Rank 1
Szilard asked on 28 Mar 2012, 01:11 PM
Hello,

I am working on binding an upshot dataSource to a kendoGrid, using Knockout-Kendo.js
I managed to display the data correctly, by manually configuring which columns to show with what fields, and the grid is refreshed when the underlying data is changed. However I am having trouble with the pagination: the grid is looking at the actual amount of data that upshot has locally, and defines its pages based on that. However, I don't want to get all the data at once with upshot, only one page at a time.

Ex. I have 15 objects on the server, and I set my pageSize in the grid to 5, as well as upshot paging to 5, but with an includeTotalCount so I get back the TotalCount=15. Now, since upshot only has 5 local entities, the grid will only display one page, with these 5 items, even if I set
dataSource: {
 total: dataSource.getTotalEntityCount(), //which returns 15
 pageSize: 5
}

Is there any way I can tell the kendoGrid dataSource to show me the page numbers based on the total number specified, even if no actual data is present? Also, how would I then be able to pass the paging information (take,skip) options down to upshot, so it can make the requests based on those filters?

Thanks,
Szilard

2 Answers, 1 is accepted

Sort by
0
Robert Tiddy
Top achievements
Rank 1
answered on 09 May 2012, 05:17 AM
I urgently need to do this too guys! If any suggestions, that would be great!

I've made to successfully do this, but just missing the page numbers... I can set "Total" in the datasource upon the first setup, but once adding new rows or adding to the datasource.add the "Total" changes, we need to be able to change "Total" in the datasource for ever to some value in the future...

Robert.
0
Alexander Valchev
Telerik team
answered on 14 May 2012, 07:40 AM
Hello guys,

I am afraid I cannot understand what exactly your scenario is. Is it possible to provide a small but runnable example that we can examine in details? Please send us such example and we will check it right away.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Szilard
Top achievements
Rank 1
Answers by
Robert Tiddy
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or