0

Problem changing icon class from master detail

asked 2014-02-25 18:30:35 +0800

JMVAZ gravatar image JMVAZ
13 3

I'm tring to customize master detail to use icon caret-down instead of angle-down from Font Awesome.

For that I had overided the functions getIconOpenClass_ and getIconCloseClass_ of the widget "zkex.grid.Detail".

I had done this like this:

<detail w:getIconOpenClass_="function () { return 'z-icon-caret-down';  }" 
    w:getIconCloseClass_="function () { return 'z-icon-caret-right';  }">
</detail>

When I do this I get the new icon, but I have one infinite loop and eventually one error in JS console:

"Uncaught RangeError: Maximum call stack size exceeded"

Stacktrace:

bH.fn.extend.hasClass zk.wpd:8 zkex.grid.Detail.zk.$extends.onShow zkex.grid.wpd:2 n zk.wpd:13 zk.$extends.fire zk.wpd:13 o zk.wpd:13 zWatch.fireDown zk.wpd:13 zUtl.fireShown zk.wpd:18 zkex.grid.Detail.zk.$extends.open zkex.grid.wpd:2 zkex.grid.Detail.zk.$extends.onShow zkex.grid.wpd:2 n zk.wpd:13 zk.$extends.fire zk.wpd:13 o zk.wpd:13 zWatch.fireDown zk.wpd:13 zUtl.fireShown zk.wpd:18 zkex.grid.Detail.zk.$extends.open zkex.grid.wpd:2 zkex.grid.Detail.zk.$extends.onShow zkex.grid.wpd:2 n

I had analyzed the src code of ZK, and I think there is one bug in the definition of method isContentSclass:

zkex.grid.Detail = zk.$extends(zul.Widget, {

             isContentSclass: _zkf$,: function () {
                if (this._open) {
                       if (!jq(this.$n("icon")).hasClass("z-icon-angle-down")) {
                           this.open(this._open, true)
                       }
                    }
              }

}

I think that the css class cannot be placed directly, but must be received using the corresponding function getIconOpenClass_

Can anyone give me some input for this?

Thanks, Regards.

delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

answered 2014-02-26 16:30:15 +0800

RaymondChao gravatar image RaymondChao
386 1 4
ZK Team

It's a bug, sorry for any inconvenience caused.

Here is the workaround for the situation, please add the following code to zul:

<script><![CDATA[
    zk.afterLoad('zkex.grid', function() {
      zk.override(zkex.grid.Detail.prototype, 'onShow', function () {
        if (this._open) {
          if (!jq(this.$n('icon')).hasClass(this.getIconOpenClass_()))
            this.open(this._open, true);
          }
      });
    });
]]></script>

This issue had been created for tracking.

link publish delete flag offensive edit
0

answered 2014-03-19 09:59:05 +0800

JMVAZ gravatar image JMVAZ
13 3

Thanks its working!

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
1 follower

RSS

Stats

Asked: 2014-02-25 18:30:35 +0800

Seen: 56 times

Last updated: Mar 19 '14

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