src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js
function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) {
			// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)
			if (!bIgnore) {
				if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) {
					fnMap(oNode, oRecursionBreaker, "positionInParent", iPositionInParent, oParent);
					if (oRecursionBreaker.broken) {
						return;
					}
				}
			}
			fnCheckNodeForAddedSubtrees(oNode);
			if (oRecursionBreaker.broken) {
				return;
			}

			// if the node also has children AND is expanded, dig deeper
			if (oNode && oNode.children && oNode.nodeState.expanded) {
				for (var i = 0; i < oNode.children.length; i++) {
					var oChildNode = oNode.children[i];
					// Make sure that the level of all child nodes are adapted to the parent level,
					// this is necessary if the parent node was placed in a different leveled subtree.
					// Ignore removed nodes, which are not re-inserted.
					// Re-inserted deep nodes will be regarded in fnTraverseAddedSubtree.
					if (oChildNode && !oChildNode.nodeState.removed && !oChildNode.nodeState.reinserted) {
						oChildNode.level = oNode.level + 1;
					}
					// only dive deeper if we have a gap (entry which has to be loaded) or a defined node is NOT removed
					if (oChildNode && !oChildNode.nodeState.removed) {
						fnTraverseDeepSubtree(oChildNode, false, oNode, i, oIgnoreRemoveForNode);
					} else if (!oChildNode) {
						fnMap(oChildNode, oRecursionBreaker, "positionInParent", i, oNode);
					}
					if (oRecursionBreaker.broken) {
						return;
					}
				}
			}
		}
function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) {
			// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)
			if (!bIgnore) {
				if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) {
					fnMap(oNode, oRecursionBreaker, "positionInParent", iPositionInParent, oParent);
					if (oRecursionBreaker.broken) {
						return;
					}
				}
			}
			fnCheckNodeForAddedSubtrees(oNode);
			if (oRecursionBreaker.broken) {
				return;
			}

			// if the node also has children AND is expanded, dig deeper
			if (oNode && oNode.children && oNode.nodeState.expanded) {
				for (var i = 0; i < oNode.children.length; i++) {
					var oChildNode = oNode.children[i];
					// Make sure that the level of all child nodes are adapted to the parent level,
					// this is necessary if the parent node was placed in a different leveled subtree.
					// Ignore removed nodes, which are not re-inserted.
					// Re-inserted deep nodes will be regarded in fnTraverseAddedSubtree.
					if (oChildNode && !oChildNode.nodeState.removed && !oChildNode.nodeState.reinserted) {
						oChildNode.level = oNode.level + 1;
					}
					// only dive deeper if we have a gap (entry which has to be loaded) or a defined node is NOT removed
					if (oChildNode && !oChildNode.nodeState.removed) {
						fnTraverseDeepSubtree(oChildNode, false, oNode, i, oIgnoreRemoveForNode);
					} else if (!oChildNode) {
						fnMap(oChildNode, oRecursionBreaker, "positionInParent", i, oNode);
					}
					if (oRecursionBreaker.broken) {
						return;
					}
				}
			}
		}
function ( oNode , bIgnore , oParent , iPositionInParent , oIgnoreRemoveForNode ) { // ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode) if ( ! bIgnore ) { if ( ! oNode . nodeState . removed || oIgnoreRemoveForNode == oNode ) { fnMap ( oNode , oRecursionBreaker , "positionInParent" , iPositionInParent , oParent ) ; if ( oRecursionBreaker . broken ) { return ; } } } fnCheckNodeForAddedSubtrees ( oNode ) ; if ( oRecursionBreaker . broken ) { return ; } // if the node also has children AND is expanded, dig deeper if ( oNode && oNode . children && oNode . nodeState . expanded ) { for ( var i = 0 ; i < oNode . children . length ; i ++ ) { var oChildNode = oNode . children [ i ] ; // Make sure that the level of all child nodes are adapted to the parent level, // this is necessary if the parent node was placed in a different leveled subtree. // Ignore removed nodes, which are not re-inserted. // Re-inserted deep nodes will be regarded in fnTraverseAddedSubtree. if ( oChildNode && ! oChildNode . nodeState . removed && ! oChildNode . nodeState . reinserted ) { oChildNode . level = oNode . level + 1 ; } // only dive deeper if we have a gap (entry which has to be loaded) or a defined node is NOT removed if ( oChildNode && ! oChildNode . nodeState . removed ) { fnTraverseDeepSubtree ( oChildNode , false , oNode , i , oIgnoreRemoveForNode ) ; } else if ( ! oChildNode ) { fnMap ( oChildNode , oRecursionBreaker , "positionInParent" , i , oNode ) ; } if ( oRecursionBreaker . broken ) { return ; } } } }
Recursive Tree Traversal
@param {object} oNode the current node
@param {boolean} bIgnore a flag to indicate if the node should be mapped
@param {object} oParent the parent node of oNode
@param {int} iPositionInParent the position of oNode in the children-array of oParent
Recursive Tree Traversal