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

ScrollView stops scrolling after a second call to content()

2 Answers 61 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Vaughn
Top achievements
Rank 1
Vaughn asked on 23 Jan 2013, 06:38 PM
WORKS:
var data = JSON.parse(localStorage.getItem('some_stored_json_data'));
var template = kendo.template($("#template").text());
var content = kendo.render(template, data);
$("#scrollview").kendoMobileScrollView().data("kendoMobileScrollView").content("<!--" + content + "-->");

DOES NOT WORK:
var data = JSON.parse(localStorage.getItem('some_stored_json_data'));
var template = kendo.template($("#template").text());
var content = kendo.render(template, data);
$("#scrollview").kendoMobileScrollView().data("kendoMobileScrollView").content("<!--" + content + "-->");
$("#scrollview").kendoMobileScrollView().data("kendoMobileScrollView").content("<!--" + content + "-->"); // the only line different

I have ScrollView running fine with the "WORKS" code above (Templates and other HTML not attached). 

However, though the above code that "DOES NOT WORK" is nonsense, but It reproduces the problem I am having when I am trying to update the contents of a ScrollView. Can someone please confirm that they can reproduce my problem and and if it is a bug or not. 

KendoUI version: 2012.3.1315
Platform: Phonegap 2.2.0 on Android 2.2 API (running on Android 4.2 Phone). 

Cheers,
Vaughn

2 Answers, 1 is accepted

Sort by
0
Accepted
Petyo
Telerik team
answered on 24 Jan 2013, 10:07 AM
Hi,

By calling:

$("#scrollview").kendoMobileScrollView().data("kendoMobileScrollView").content("<!--" + content + "-->");

You re-initialise the widget, which is not supported. 

The correct approach for subsequent calls would be:

$("#scrollview").data("kendoMobileScrollView").content("<!--" + content + "-->");

 

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
Vaughn
Top achievements
Rank 1
answered on 24 Jan 2013, 10:53 AM
Thanks Petyo. That was exactly my problem.
Tags
ScrollView (Mobile)
Asked by
Vaughn
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Vaughn
Top achievements
Rank 1
Share this question
or