andrej_marincic
18 Jan 2012, 3:56 AM
Hello,
for whole day now i'm trying to create simple MVC application. What i'm trying to do is create Viewport with west and center region like this:
Ext.create('Ext.container.Viewport', {
layout: 'border',
renderTo: Ext.getBody(),
items: [
{
region: 'west',
layout: 'fit',
width: 200,
html: "<ul id='main-menu'><li>option 1</li><li>option 2</li><li>option 3</li></ul>"
},
{
region: 'center',
layout: 'fit',
xtype: 'userlist'
}]
});
in controller init() function i put:
this.control({
'#main-menu > li': {
click: function(){
alert("clicked");
}
}
});
but click handler never gets called.
Can control function only handle events on components or can i attach events to arbitrary HTML node?
best regards, and thank you for answer :-)
for whole day now i'm trying to create simple MVC application. What i'm trying to do is create Viewport with west and center region like this:
Ext.create('Ext.container.Viewport', {
layout: 'border',
renderTo: Ext.getBody(),
items: [
{
region: 'west',
layout: 'fit',
width: 200,
html: "<ul id='main-menu'><li>option 1</li><li>option 2</li><li>option 3</li></ul>"
},
{
region: 'center',
layout: 'fit',
xtype: 'userlist'
}]
});
in controller init() function i put:
this.control({
'#main-menu > li': {
click: function(){
alert("clicked");
}
}
});
but click handler never gets called.
Can control function only handle events on components or can i attach events to arbitrary HTML node?
best regards, and thank you for answer :-)