Question

I have a text in the container (please see the code below). When user taps on that text, another view should be displayed. I have checked Sencha docs again and I see there is no tap event for Ext.Container.

So, my question is: should I display a button (and work on css styles so there are no borders etc) and it has tap event, or there is a better way to solve this simple question?

 {
    xtype: 'container',
    cls: 'myClass',
    html: 'go to another view'
 },

Thank you.

Was it helpful?

Solution

You can add a tap listener to the element on initialization:

{
    xtype: 'container',
    cls: 'myClass',
    html: 'go to another view',
    listeners: {
        initialize: function(ct) {
            ct.element.on('tap', function() {
                Ext.Viewport.add({ xtype: 'other-panel' });
            });
        }
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top