I have a tree with filtering. Items wich doesn't meet filtering conditions set invisible (treeItem.setVisible(false)). So childs of items can be not bound to the DOM tree. When I open or close items I get an error "Unable to get property 'style' of undefined or null reference" File: zul.sel.wpd, Line: 3685, Column: 5
.
I fixed this by overriding _showKids:
zk.override(zul.sel.Treeitem.prototype, _wgt, {
_showKids: function () {
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);
}
}
});