-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.8.1, 9.5.0.1
Steps to Reproduce
https://zkfiddle.org/sample/38ncf4t/6-Hiding-treeitem-and-using-mold-paging
Click the "hide treeitem 2.1" button
Click on the carret of item2 to close it
Current Result
item 2 doesn't close, error in JS console
zul.sel.wpd:5159 Uncaught TypeError: Cannot read property 'style' of null at init._showKids (zul.sel.wpd:5159) at init._showKids (zk.wpd:48480) at init._showKids (za11y.wpd:103) at init.open (zul.sel.wpd:5129) at init.<anonymous> (zk.wpd:11140) at init.setOpen (zk.wpd:48480) at init.doClick_ (zul.sel.wpd:5568) at _doEvt (zk.wpd:27358) at HTMLDocument.<anonymous> (zk.wpd:27554) at HTMLDocument.dispatch (zk.wpd:5614)
Expected Result
no error
Debug Information
Treeitem widget is not rendered, cause widget.$n() to return null
No error in default mold.
Workaround
<script> <script><![CDATA[ zk.afterLoad("zul.sel", function () { var _xTreeitem = {}; zk.override(zul.sel.Treeitem.prototype, _xTreeitem, { _showKids: function (open) { var tc = this.treechildren; if (tc) for (var w = tc.firstChild, vi = tc._isRealVisible(); w; w = w.nextSibling) { if(w.$n()){ w.$n().style.display = vi && w.isVisible() && open ? '' : 'none'; if (w.isOpen()) w._showKids(open); } } } }); }); ]]></script>