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

e.fetch error on setDataSource

1 Answer 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eduardo
Top achievements
Rank 1
Eduardo asked on 25 Nov 2016, 11:15 PM

Hello,

The grid loads remote data at setup without any problems. However, in a button click event, I set the same url as source, like this:

1.$("#budgetGrid").data("kendoGrid").setDataSource({
2.  transport: {
3.    read: loadURL,
4.  },
5.});

 

And I get this error:

1.kendo.all.js:45851 Uncaught TypeError: e.fetch is not a function(…)
2.setDataSource @ kendo.all.js:45851
3.click @ Default.aspx?uid=6674:213
4.trigger @ kendo.all.js:124
5._click @ kendo.all.js:26017
6.d @ jquery.min.js:2
7.dispatch @ jquery.min.js:3
8.r.handle @ jquery.min.js:3

I've compared the output of the remote method and it's the same.

Thank you for any pointer.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 28 Nov 2016, 07:36 AM
Hello Eduardo,

Please try setting the Kendo UI Grid Data Source with a data source instance as outlined at:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-setDataSource

var newDs = new kendo.data.DataSource({
  transport: {
  read:  loadURL
 }
});
 
var grid =$("#budgetGrid").data("kendoGrid");
grid.setDataSource(newDs);

I created a sample runnable demo at:

http://dojo.telerik.com/EzIVE

Regards,
Alex Hajigeorgieva
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Grid
Asked by
Eduardo
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or