Why doesn't a simple click: function()… work in ExtJS?

前端 未结 5 1644
滥情空心
滥情空心 2021-01-14 05:12

When the user clicks on this element, I want it to show an alert.

However, when I click on the DIV that this Panel generates, nothing happens.

How ca

5条回答
  •  春和景丽
    2021-01-14 05:33

    I believe you need something like:

    var content = new Ext.Panel({
        region:'center',
        margins:'5 0 5 5',
        cls:'empty',
        bodyStyle:'background:ivory; font-size: 13pt',
        html:'

    This is where the content goes for each selection.

    ', listeners: { click: function() { alert('was clicked'); } } });

提交回复
热议问题