The below function reads from a specific URL and loads the contents into myDiv using a template and listView. The function works perfect the first time. How can I force the view to refresh with new data each time the function runs (the function is triggered externally)?
function loadNewFeed(url) {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: url,
dataType: "json"
}
}
});
$('#myDiv').kendoListView({
dataSource: dataSource,
template: kendo.template($("#reviewsTemplate").html())
});
};
function loadNewFeed(url) {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: url,
dataType: "json"
}
}
});
$('#myDiv').kendoListView({
dataSource: dataSource,
template: kendo.template($("#reviewsTemplate").html())
});
};
6 Answers, 1 is accepted
0
Mike
Top achievements
Rank 1
answered on 17 Apr 2012, 06:10 PM
I've been testing this issue further, and have found the following:
When the function first runs, it executes perfectly and renders the data via the template.
Upon subsequent runs the following javascript error occurs in Firebug:
Error: "b is null"
Script: kendo.all.min.js (line 8)
Can someone from Telerik, please respond and let me know if there is a solution to this issue?
thanks,
When the function first runs, it executes perfectly and renders the data via the template.
Upon subsequent runs the following javascript error occurs in Firebug:
Error: "b is null"
Script: kendo.all.min.js (line 8)
Can someone from Telerik, please respond and let me know if there is a solution to this issue?
thanks,
0
Hi,
Re-initializing the widget each time is not supported. You should create the datasource (and the widget) once, and then subsequently use the DataSource read method for data fetching.
All the best,
Petyo
the Telerik team
Re-initializing the widget each time is not supported. You should create the datasource (and the widget) once, and then subsequently use the DataSource read method for data fetching.
All the best,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mike
Top achievements
Rank 1
answered on 18 Apr 2012, 02:59 PM
Petyo,
Thanks for the info. I tried using the read method, but it didn't work. Using the above example can you give me an example of where/how to use the read method?
Thanks,
Thanks for the info. I tried using the read method, but it didn't work. Using the above example can you give me an example of where/how to use the read method?
Thanks,
0
Hi,
Not really, as I don't see your project, and don't know what your business logic is. In general, you should call it where you are currently using the loadNewFeed. If need further assistance, I would like to recommend opening a support ticket with a sample project attached, so that we can assist you further.
Kind regards,
Petyo
the Telerik team
Not really, as I don't see your project, and don't know what your business logic is. In general, you should call it where you are currently using the loadNewFeed. If need further assistance, I would like to recommend opening a support ticket with a sample project attached, so that we can assist you further.
Kind regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
0
De
Top achievements
Rank 1
answered on 19 Apr 2012, 05:04 AM
Hai Im a new member to this forum just now I had gone through some topics and I came to a conclusion that this is very useful and thank you for all...........