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

Scroll View with data template

2 Answers 87 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 09 Jul 2013, 03:38 PM
I am trying to use a template to render pages in a scroll view and I have run into some issues ...  I have a jsFiddle that shows what I am trying to do the group has a red header with 'why does this not work'.  I have a bunch of examples of things using templates and I don't understand why the template with the scroll view does not behave like the rest, could someone explain what I am missing?

http://jsfiddle.net/6RuHQ/6/

In case you are curious I am probably going to wind up with the last approach with my application since in some occasions I will end up with only 1 page and it looks silly as a scroller with 1 page (I'd rather just render that single page by itself).

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 09 Jul 2013, 08:02 PM
I did some fooling around with data source binding with templates to get something similar working, and came across something that seems to be behaving strangely.

Could you explain why in this fiddle (http://jsfiddle.net/2PTLE/1/) that pressing the 'change Dummy' button causes the template to not appear properly any longer?

I don't understand why the template would render fine once but then improperly afterwards ...

I realize I may be trying to do something advanced but I need the contents of a scroller to change based on an item that is currently selected (the selected item may have an array of dataobjects that need to be displayed on seperate pages).  I can brute force this and code it all in javascript if I need to but that is not appealing.
0
Petyo
Telerik team
answered on 10 Jul 2013, 07:50 AM
Hello David,

The scrollview is somewhat sensitive to dimensions change. By default, it sets its dimensions when the containing view is displayed. In your case, you will have to call the refresh method manually. Please see the updated example for what I mean.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ScrollView (Mobile)
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or