Question

I have root view Extends Ext.navigation.View . I'm pushing a view called Add Item.

   this.push({
        title:'Add Item',
        xtype:'additempanel'
    });

From that view I'm again pushing a view called Select Category

button.up('itempanel').push({
        xtype: 'selectcategorypanel',
        title: 'Select Category'
    });

I have a list in this view .But tapping an item on this list is calling root view's itemtap.

My app controller

config: {
        refs: {
items :"itempanel",
SelectCategoryPanel : "selectcategorypanel"
}



'selectCategoryPanel list' : {
                itemtap: 'selectCategoryItemTap'
            }

  'itempanel list' : {
                itemtap: 'showPost'
            },

The show post method is always getting called. The item tap of selectCategoryPanel is never called please help me.

Was it helpful?

Solution

Your selector for the selectCategoryItemTap listener appears to be incorrect. You can fix it by either using the xtype of the view, or by setting another ref that points to the list.

By xtype:

control: {
    'selectcategorypanel list': {
        itemtap: 'selectCategoryItemTap'
    }
}

By ref:

refs: {
    selectCategoryPanelList: 'selectcategorypanel list'
},
control: {
    selectCategoryPanelList: {
        itemtap: 'selectCategoryItemTap'
    }
}

Right now the 'selectCategoryPanel list' selector isn't actually pointing to anything that Sencha can find, so it won't be able to attach the listener to it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top