0

Override Icon in Layout region

asked 2014-06-17 11:46:20 +0800

eclipse2 gravatar image eclipse2
17 4

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!

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-06-18 07:31:13 +0800

vincentjian gravatar image vincentjian
2245 6

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
});
link publish delete flag offensive edit
0

answered 2014-06-19 15:25:39 +0800

eclipse2 gravatar image eclipse2
17 4

It works, thanks!

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-06-17 11:46:20 +0800

Seen: 22 times

Last updated: Jun 19 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More