2015-09-10 3 views

ответ

1
Ext.define('FirstApp.controller.details', { 
extend: 'Ext.app.Controller', 

config: { 
    stores : ['your store'], 
    models : ['your model'], 
    refs: { 
     myContainer: 'your view' 
    }, 
    control: { 
     'your view': { 
      activate: 'onActivate',// fires when view is activated 
      itemtap: 'onItemTap',// fires when item is tapped 
     } 
    } 
}, 
onActivate: function() { 
    console.log('Main container is active'); 
}, 

onItemTap: function(view, index, target, record, event) { 
    console.log('Item was tapped on the Data View'); 
    console.log(view, index, target, record, event); 
    Ext.Msg.alert('', 'The user selected is: ' + record.get('username')); 
}, 

});

0

Внедрение крана панели как это. Это будет работать.

Ext.define('YourApp.view.text', { 
extend: 'Ext.Panel', 
xtype: 'text', 
initialize: function() { 
    this.element.on({ 
     tap: function() { alert('tapped!'); } 
    }); 
} 

});