Hi Isomorphic,
I have TreeGrid and I’m implementing lookup node mechanism: when TreeGrid shows it automatically navigates to the given node in the tree.
Here is the code that describes the main idea:
treeGrid.dataProperties.dataArrived = function(parentNode) {
... // here is some condition, preparation etc.
nextNode = lookupChild(previousNode, code);
...
treeGrid.openFolder(nextNode);
...
treeGrid.selectRecord(nextNode);
...
};
treeGrid.fetchRootNodes('*', null, function() {
...
treeGrid.openFolder(node);
...
});
var lookupChild = function(node, code) {
var children = treeGrid.data.getChildren(node);
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.obj.code == code) {
return child;
}
}
return null;
}
But the problem is that it sometimes work and sometimes does not. The message “Contacting server…” appears, screen freezes and you can’t do anything and should reload an application.
Maybe method dataArrived is called when it is not finished previous time. I can’t find where the problem is. Could you help me?
Firefox show a JavaScript error: “_14 is null” in the next line:
“if(!_11)return;var _13=isc.isA.Number(_2);if(_13&&_2<=0)_2=_5?0:1;var _14=this.getTableElement(_1);if(_2==0&&_5){_14.style.display=“none”}else{_14.style.display=isc.emptyString;for(var i=_7;i<=_8;i++){var _16=this.getTableElement(_1,i);if(_16){var _17=(!isc.Browser.isIE||isc.Browser.isStrict)?this.$o5:this.$27v;if(_5){_16.height=_2;_16.style[_17]=isc.emptyString}else{_16.height=isc.emptyString;_16.style[_17]=_2}”
Best regards,
Ihor.