1
votes

In my sencha touch app i have a NavigationView container which loads a panel view containing a list rendered from a store.

I have a tab-bar in which each tab opens this NavigationView container adding, depending on which tab is tapped, some extraparams in the store used by the panel view inside the NavigationView container.

This is working OK and for each tab i get the NavigationView container and inside it the panel view containing the right list for that tab.

The problem is these lists have some child lists that need to be loaded when tapping a list item. I do this using the following controller that pushes in the NavigationView container another view Panel containing the child list:

Ext.define('FirstApp.controller.Details', {
extend: 'Ext.app.Controller',
config: {
    refs: {
        // this is my NavigationView container 
        placesContainer:'placesContainer'    
    },
    control: {

'placesContainer categorie list':{
            itemtap: 'chooseCategory' 
        },

And my chooseCategory function is:

chooseCategory:function(list,index,target,record){
            //these add some extra params to my store's proxy
    Ext.getStore('Articoli').getProxy().setExtraParams({ catid: record.data.id });
    Ext.getStore('Articoli').load();

    this.getPlacesContainer().push({
        // this is the target view panel
        xtype:'articoli',
        title:record.data.title,
        data:record.data
    })

}

And this works very well but when you click on a list item, its child list is pushed inside the first tab panel. Example: i tap on the 3rd tab. The app shows the list corresponding to the 3rd tab. I tap on one of the list's items. The app loads its child list in 1st tab panel. I cannot see any changes until i tap on the first tab. There i can see loaded the child list of tab 3.

1

1 Answers

0
votes

You can give onDisclosureItem:true to your list and in the controller give an disclose event so that on disclose it would load the sub categories and on item tap it would navigate you to the other view

'placesContainer categorie list':{
            itemtap: 'chooseCategory',
            disclose: 'openSubCategory'
        },