PDA

View Full Version : Ext.Viewport.setActiveItem in 4.x?



antun
10 Oct 2012, 9:37 PM
I've seen a bunch of references to Ext.Viewport.setActiveItem() for switching which view is currently displayed.

However, in 4.1.1a, that method doesn't appear to exist:

console.log(Ext.Viewport.setActiveItem);

... results in undefined. I can't seem to track down the Ext.Viewport object in the 4.x docs either. And searching for setActiveItem in the 4.x docs yields 3 results, none of which look like they're the method I'm looking for.

Has this been replaced with a different call in 4.x?

Thanks,

Antun

vietits
10 Oct 2012, 11:39 PM
It seems that Ext.Viewport.setActiveItem() (http://docs.sencha.com/touch/2-0/#!/api/Ext.Viewport-method-setActiveItem) exists on Sencha Touch not on Ext JS.

antun
15 Oct 2012, 9:54 AM
D'oh! Thanks.

I feel a bit silly. I'm actually building a site primarily aimed for mobile devices. I wanted to get stuck in quickly, so I didn't read into the differences between Ext JS and Sencha Touch at first. I mistakenly downloaded Ext JS, and started building with that, thinking that it was geared towards mobile sites. After I read your post, I realized that Sencha Touch was for sites (not just compiled mobile apps), and I was using the wrong tool for my needs.

Over the weekend, I ported my site to Sencha Touch. The UI looks better on mobile devices too.

Thanks for steering me in the right direction.