Extjs6图片控件功能扩展,增加tip和点击事件

如何让我们的图片也能点击,类似imagebutton一样,还有可以显示tips,和按钮一样,这就需要在事件里做文章。废话不多说,直接上代码。

{
                                    xtype : 'image',
                                    src : "../MainView/newView/images/system.png",
                                    width:16,
                                    margin:'0 10 0 10',
                                    listeners : {
                                        afterrender: function(c) {
                                                Ext.create('Ext.tip.ToolTip', {
                                                    target: c.getEl(),
                                                    html: '切回老版本'
                                                });
                                            },
                                        el : {
                                            click : function() {
                                                window.open("../Desktop");
                                            }
                                        }
                                    }
                                }

猜你喜欢

转载自blog.csdn.net/iamcookie/article/details/82107970