-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm trying to change the icon of the layout region. I created this code to place in zul, but is not loading. What I'm doing wrong?
<script>
<![CDATA[ zk.afterLoad('zul.Widget',
function() {
zk.override(zul.layout.LayoutRegion.prototype, 'getIconClass_', function (collapsed) {
var BL = zul.layout.Borderlayout;
switch(this.getPosition()) {
case BL.NORTH:
return collapsed ? 'z-icon-angle-double-down' : 'z-icon-angle-double-up';
case BL.SOUTH:
return collapsed ? 'z-icon-angle-double-up' : 'z-icon-angle-double-down';
case BL.WEST:
return collapsed ? 'z-icon-angle-double-right' : 'z-icon-angle-double-left';
case BL.EAST:
return collapsed ? 'z-icon-angle-double-left' : 'z-icon-angle-double-right';
}
return '';
});
}); ]]></script>
Thanks!
Hi, the first argument of zk.afterLoad function is the package name, not the widget name. Try modify you code as follows:
zk.afterLoad('zul.layout', function() {
// omitted
});
Asked: 2014-06-17 11:46:20 +0800
Seen: 24 times
Last updated: Jun 19 '14