我需要能够隐藏网格(在食物标题栏下),当食物标题栏被点击时。
根据我所发现的,我不得不使用事件委托,但是由于某种原因,我使用Alert()进行的测试在我点击食品TitleBar时没有做任何事情。
有人能帮我吗?(使用architect,所以对我来说使用architect会更容易,因为生成的大部分代码都是ReadOnly -_-')

发布于 2013-05-24 00:02:33
我只用过architect一次。但是我非常确定有一个界面可以编辑它生成的代码。Here is the demo to implement a click on the titlebar。
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: ('SF' || 'SenchaFiddle'),
launch: function () {
Ext.define('MyApp.view.home', {
extend: 'Ext.Container',
xtype: 'homecontainer',
config: {
items: [{
xtype: 'toolbar',
title: 'test',
dock: 'top',
listeners: {
painted: function (element, opt) {
element.on('tap', function () {
alert('Test');
});
}
}
}]
}
});
Ext.Viewport.add(Ext.create('MyApp.view.home'));
}
});https://stackoverflow.com/questions/16717423
复制相似问题