sencha > 点击下一级页面 NavigationView

IndexCard.js

Ext.define('Sencha.view.IndexCard', {
    extend: 'Ext.NavigationView',
    xtype: 'index_card_xx',
    requires: [
		'Sencha.view.Index',    
        'Sencha.view.IndexListShow'
    ],
    config: {

        title: 'home',
        iconCls: 'time',

        autoDestroy: false,

        items: [
            {
                xtype: 'index_xx'
            }
        ]
    }
});

 

control/main.js

Ext.define('Sencha.controller.Main', {
    extend: 'Ext.app.Controller',

    config: {  
        refs: {
            indexCard: 'index_card_xx',
            indexList:'index_list_xx',
            indexListShow:'index_list_show_xx'
        },    	
        control: {     	
            indexList: {
                itemtap: 'onContactSelect',
            }  
        }  
    },  
  
    onContactSelect: function(list, index, node, record) {
	
        if (!this.indexListShow) {
            this.indexListShow = Ext.create('Sencha.view.IndexListShow');
        }

        // Bind the record onto the show contact view
        //this.indexListShow.setRecord(record);

        // Push the show contact view into the navigation view
        this.getIndexCard().push(this.indexListShow);
    }

});

 

view/indexlistShow.js  (下一级页面)

Ext.define('Sencha.view.IndexListShow', {
    extend: 'Ext.Container',
    xtype: 'index_list_show_xx',
    config: {
        title: 'Information',
	    fullscreen: true,  
	    layout: 'vbox',         
        items: [
            {
	            xtype: 'panel',  
	            html: 'message list',  
	            flex: 1  
            }
            
        ]
    }
});

 

你可能感兴趣的:(sencha)