日期:2014-05-16  浏览次数:20568 次

ExtJS 按钮重新渲染的问题
本人想通过事件触发来重新渲染button 空间的背景 但是没有效果啊~! 求助高人帮忙。API里面也没有相应重新渲染的方法啊~!

代码如下:
JScript code
var imageBtn = Ext.create("Ext.button.Button", {
                y: 2,
                width: everyBtnWidth,
                height: everyBtnHeight,
                element: _skinModulePosition,
                style: 'background:url(' + loadIcon + ')',
                listeners: {
                    "click": function (element) {
                        me.skipFunction(workarea, element);
                    },
                    "mouseover": function (element) {
                        //var tempModelName = Ext.getCmp();

                        var mouseoverImg = "./images/homepage/" + element.element + "_1.png";
                        element.style = 'background:url(' + mouseoverImg + ')';
                        element.render();
                    },
                    "mouseout": function (element) {
                        var mouseoutImg = "./images/homepage/" + element.element + "_0.png";
                        element.style = 'background:url(' + mouseoutImg + ')';
                        element.render();
                    }
                }

            });


------解决方案--------------------
关键字:
button的 pressedCls overCls focusCls 配置

css hack