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

Scrollview headaches

2 Answers 100 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ioan
Top achievements
Rank 1
Ioan asked on 12 Nov 2014, 03:15 PM
Here is a jsbin:
http://jsbin.com/yacexujequ/6/edit

In second view there's a ScrollView which I want to initialize dynamically via a button.
The problem is the ScrollView is unresponsive. You simply can't swipe through pages.
But if I initialize it on view show, it works without a hitch.
Please tell me what am I doing wrong...

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 14 Nov 2014, 12:04 PM
Hi Ioan,

The issue occurs because the widget is build after View is initialized. In that case the widget will not be able to automatically calculate its dimensions.
The solution is to manually refresh it.
var buttonclick = function () {
    $("#gallery").kendoMobileScrollView({
      dataSource: {
        data: [{ id: 1, name: "abc" }, { id: 2, name: "abccc" }, { id: 3, name: "abcc" }] },
        template: "${name}",
        contentHeight: "100%"
    })
    .getKendoMobileScrollView()
    .refresh();
};

I hope this information will help.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ioan
Top achievements
Rank 1
answered on 18 Nov 2014, 12:09 PM
Yes, that worked! Thank you!  I had a hunch that might be the cause, but I didn't suspect a simple refresh would do the trick...
Tags
ScrollView (Mobile)
Asked by
Ioan
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Ioan
Top achievements
Rank 1
Share this question
or