-
Bug
-
Resolution: Fixed
-
Normal
-
8.6.0.1
-
None
-
Security Level: Jimmy
-
None
-
ZK 8.6.1 S1
Steps to Reproduce
run fiddle
http://zkfiddle.org/sample/1ho88ob/1-hidden-tab-tree-initpadsizes
Go to the "tree" tab
click the add button 3 times to add some tree items
Go to the the "buttons" tab
Click on the add button 3 times to add some tree items
Go to the "Tree" tab again
Current Result
tree is shrunk to 2 treeitems
additional clicks on the add button will cause the tree to resize, then will cause the tree to add missing items
Expected Result
tree initPadSize calculation should not fail offscreen
Debug Info
When the dom node is hidden, calculation fails due to missing height information.
Will affect any case where a tree is updated while hidden.
Root Cause
in the _initPadSizes function, b.offsetHeight == 0 if the dom node is hidden
Workaround
<script><![CDATA[ zk.afterLoad('zul.sel', function() { var xTree = {}; zk.override(zul.sel.Tree.prototype, xTree ,{ onShow : function() { this._initPadSizes(); }, bind_: function(){ var result = xTree.bind_.apply(this, arguments); zWatch.listen({onShow: this}); }, unbind_: function(){ zWatch.unlisten({onShow: this}); var result = xTree.unbind_.apply(this, arguments); } });//zk.override });//zk.afterLoad ]]></script>
- relates to
-
ZK-3835 Improve Tree client ROD rendering method
- Closed