ExtJS – Evento click a un label

SENCHA20EJS.preview

Cuando necesitamos agregar el evento click a un compenten tipo Label no podemos hacerlo directamente por lo que debemos tener un código como sigue:

onFormAfterRender: function(component, eOpts) {
        //Click en label
        this.getView().down('#lbTerminos').getEl().on('click',function(){

            Ext.create('Ext.window.Window', {
                height: 450,
                width: 650,
                padding: 10,
                modal: true,
                cls: "pad-text",
                layout: 'fit',
                items: {  // Let's put an empty label html
                    xtype: 'label',
                    html : '<h1>Ventana que se abre al hacer click</h1>'
                }
            }).show();
        });
    },

Deja un comentario