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

Grid Paging Event?

2 Answers 239 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 13 Aug 2012, 08:51 PM
I'm trying to bind to a custom transport and get paging to work. Essentially I have a function that retrieves a set of records and places them on a view model as a list. I'm overridding the total count of the grid by retrieving it from a column on the data, like this:

dataSource: new kendo.data.DataSource({
                        data: this.results,
                        schema: {
                            data: function (data) {
                                return data;
                            },
                            total: function(data) {
                                if (data.length > 0) {
                                    return data[0].rowCount;
                                }
                                return 0;
                            },
                            type: "json"
                        }
                    }),

I have two issues, however. First is that when I set the total count, I get "NaN - NaN of 1000 total items" on the grid. Not sure where the NaN is coming from. Second, I need to fetch the next page when the user interacts with the paging control. Again, I'm not pointing the kendo grid to an API end point, I'm fetching that data myself and just binding to a list. Is there a way I can intercept the paging event so that I can load the next page of data and refresh the binding for the grid?

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Aug 2012, 03:09 PM
Hello Jeremy,

 Unfortunately we are not sure what may cause this problem. Is there a chance to provide a jsbin example showing that behavior?

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sigfrido
Top achievements
Rank 1
answered on 22 Oct 2012, 08:28 PM
Hello, I am also looking to intercept the Grid Paging event in Javascript, fetch data from my server (we use a proprietary RESTful protocol) and then feed the data to the grid.

What is the JavaScript function or event that I can hook into?
Tags
Grid
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
sigfrido
Top achievements
Rank 1
Share this question
or