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

ScrollView cannot be rendered outside a view, layout or modalview in the Q1 release?

2 Answers 49 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 2
Jim asked on 18 Jun 2013, 09:21 PM
Hello,

I have a custom mobile site that is using a hand-built mobile framework, but at the end of last year, we imported a kendo ScrollView into the site in order to have and improved image carousel.

This worked flawlessly, we simply called:
$(SELECTOR_HERE).kendoMobileScrollView();

This week, we attempted to update the site to the Q1 release (v2013.1.319 ) of the Kendo Framework, and found that this line has started throwing an error and no longer creates a carousel.

 After importing the non-compressed version of kendo mobile, I was able to track down the following:
MobileWidget = Widget.extend({
        ...
        ...
        container: function() {
            var element = this.element.closest(kendo.roleSelector("view layout modalview"));
            return kendo.widgetInstance(element, kendo.mobile.ui) || ContainerNullObject;
        }

After running the debugger, I can see that element is undefined, so I am assuming that kendo is now assuming that I am forcing the whole site to be a mobile app... which would be a ton of work to implement on this legacy site.

Has kendo officially stopped supporting individual initialization of the mobile components unless you are running the whole page as an app? (this would be very disappointing and greatly reduce the usefulness of the product for my company)

If not, can anyone tell me if the syntax changed or something in Q1?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 21 Jun 2013, 06:25 AM
Hello James,

All Kendo UI Mobile widgets (except the Scroller, which is enabled for certain web widgets, too) assume to be inside an instantiated Kendo UI Mobile application (and mobile view) in order to function correctly. All demos and code snippets in our documentation showcase that approach. 

By coincidence, the scrollview widget was not using any of the mobile application features until the Q1 release. However, we introduced certain improvements related to the way widgets refresh when the container is displayed. This is the reason for the change in the source code in question.

Currently, I can suggest the following workarounds for your case:

- reverse-engineer and mock the container element and its respective widget instance;
- modify the source code and remove the container references;
- keep using the previous version of Kendo UI. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jim
Top achievements
Rank 2
answered on 21 Jun 2013, 03:18 PM
Thanks,

I went with the third option (just downgrade mobile) while I was waiting for a reply.  

Long term, I would like to figure out option 1 (include a mobile app) but that is likely to perform oddly to have an App as a sub component of the overall page, particularly when we have multiple carousels on a page,  though I have successfully created a mobile app as a "control panel widget" inside a normal desktop page.

Thanks for the confirmation.  I'll post an update if I come up with a non-hacky solution to this problem.
Tags
ScrollView (Mobile)
Asked by
Jim
Top achievements
Rank 2
Answers by
Petyo
Telerik team
Jim
Top achievements
Rank 2
Share this question
or