-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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.
Asked: 2014-02-25 18:30:35 +0800
Seen: 56 times
Last updated: Mar 19 '14