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

Auto-binding a ListView to a DataSource always calls remote service, even if it already has data loaded

2 Answers 94 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Jonathan M
Top achievements
Rank 1
Jonathan M asked on 21 Feb 2013, 11:00 PM
We have a DataSource bound to remote service. If we call the query function from one view, and then navigate to a view that has a ListView that auto-binds to the same DataSource, it always calls the remote service again, even if the DataSource already has data loaded. We would expect it to bind to the DataSource and use the data that is already loaded, rather than make the same call back to the remote server again.

We have found a workaround, in that we can disable auto-binding and call the refresh function on the ListView in the init event of the view, but that does not seem ideal, when really all we want it to do is auto-bind the ListView to the DataSource, and only fetch data if it is not loaded yet.

Jonathan Marston

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 25 Feb 2013, 12:42 PM
Hello Jonathan,

 
The DataSource will call service everytime if any of the server operations are enabled. This is expected, because server is the one responsible for paging, filtering and etc. The only feasible solution for the described scenario is to set the autoBind to false and render the items manually on init event of the View. In other words the solution you already taken.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jonathan M
Top achievements
Rank 1
answered on 25 Feb 2013, 05:14 PM
Thanks for the reply. The solution we have works fine for us. Just wanted to be sure we weren't doing something against what was intended.

Jonathan
Tags
ListView (Mobile)
Asked by
Jonathan M
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jonathan M
Top achievements
Rank 1
Share this question
or