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

dataSource: {data: xxx} vs datasource: xxx

3 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cliff Gibson
Top achievements
Rank 1
Cliff Gibson asked on 20 Dec 2012, 02:26 PM
I've got a json datasource and if I bind to my grid using:

{dataSource: Currencies, columns...etc} then it works OK. however if I use:

{dataSource: {data: Currencies, pageSize: 20}, columns...etc} then it does not work.

Can anyone confirm what I'm doing wrong in the second example, which is how most of the demos work...?

Cheers
Cliff

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Dec 2012, 04:31 PM
Hello,

Both approaches should be identical. The first is a shortcut for the second. The grid internally creates a instance of the Kendo DataSource using the configuration specified via the dataSource setting. Here is a live demo showing this in action: http://jsbin.com/epetiw/1/edit


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
Cliff Gibson
Top achievements
Rank 1
answered on 20 Dec 2012, 04:46 PM
Hi

Thanks for the reply, I still can't get this working so will wrap the project up and post if that is OK?

Cheers
Cliff
0
Atanas Korchev
Telerik team
answered on 21 Dec 2012, 08:12 AM
Hello,

 Do you see any JS errors? They would indicate what the problem is.

 You could attach a sample project which we can run locally to reproduce the issue.

Regards,
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!
Tags
Grid
Asked by
Cliff Gibson
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Cliff Gibson
Top achievements
Rank 1
Share this question
or