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

Failed to build pager in a grid

3 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nuo
Top achievements
Rank 1
Nuo asked on 08 Jan 2013, 03:50 AM
Hi,
I try to create a grid with Kendoui. The data are showed in the list, but the pager doesn't work. It shows No items to display. 

And if I click a column for sorting for more than three times, an error, "Uncaught TypeError: Cannot read property 'length' of undefined", will be through out at " that.length = array.length;" (line 4690 of kendo.web.js in kendoui.trial.2012.3.1114). 

The json object from Java controller is 
{"data":[{"id":9,"name":"asfsasa","number":"d","type":2,"status":"asdas","startDate":"2012-01-29","endDate":"2012-01-31","contact":"","vendor":"","hierarchy":"standalone","master":null},{"id":12,"name":"aaaaa","number":"aaaaa","type":2,"status":"aaaaaa","startDate":"2012-01-01","endDate":"2012-01-28","contact":"","vendor":"","hierarchy":"standalone","master":null},{"id":1,"name":"test1","number":"test1","type":1,"status":"test1","startDate":"2012-01-01","endDate":"2012-01-29","contact":"test1","vendor":"test1","hierarchy":"standalone","master":null},{"id":2,"name":"aaa","number":"aaa","type":1,"status":"aaa","startDate":"2012-01-01","endDate":"2012-01-27","contact":"aa","vendor":"aa","hierarchy":"standalone","master":null}]}

Please see the source code and screen shot in attachment. Could you help me? Thanks a lot.

Best regards
Shi Nuo

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 08 Jan 2013, 09:39 AM
Hi Nuo,

As you may know in order paging to work when remote binding is used you should provide the total number of records. You should also set the schema total to the field of the response which contains the total number of records.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Nuo
Top achievements
Rank 1
answered on 08 Jan 2013, 02:41 PM
Hi Roson

Thanks a lot.
The pager works after I set schema total.

But I still get an error , "Uncaught TypeError: Cannot read property 'length' of undefined", when I click a column for sorting repeatedly. It is quite strange. The sorting works fine when I only click a column no more than twice.
Firebug shows the error locates at "
that.length = array.length;" (line 4690 of kendo.web.js in kendoui.trial.2012.3.1114). 

Could you help on this? thanks.

Best regards
Shi Nuo
0
Rosen
Telerik team
answered on 09 Jan 2013, 08:05 AM
Hi Nuo,

Unfortunately, the provided information is not sufficient in order to track the cause for the described error. However, you should verify that the correct data is returned from the server during sorting. 

Regards,
Rosen
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
Nuo
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Nuo
Top achievements
Rank 1
Share this question
or