Function flushDataTree ()
{
Dataset_mainMenuTemp.setShowLoadingTip (true );
Var rootNode = tree_Menu.getFirstRootNode ();
Tree_Menu.setCurrentNode (rootNode );
Tree_Menu.expandNode (rootNode );
Dataset_mainMenu.clearData ();
Dataset_mainMenuTemp.flushData ();
Dataset_mainMenuTemp.flushDataAsync (function (succeed)
{
If (! Succeed) return;
Dataset_mainMenuTemp.disableControls ();
Try {
Dataset_mainMenuTemp.moveFirst ();
While (! Dataset_mainMenuTemp.isLast ())
{
Var record = dataset_mainMenuTemp.getCurrent ();
Var node = new RecordTreeNode (record, rootNode. getTreeLevel (). getTreeLevel ("level_menu "));
RootNode. addNode (node );
Dataset_mainMenuTemp.moveNext ();
}
} Catch (e)
{
Alert (e. message );
}
Finally {
Dataset_mainMenuTemp.enableControls ();
FlushThirdLevelNode ();
}
});
}
Function flushThirdLevelNode (){
Try {
Dataset_myMailBox.parameters (). setValue ("myBoxCoding", "box03 ");
Dataset_myMailBox.flushData ();
// Expand the current node
Var currentNode = getCurrentNodeNum (3 );
Tree_Menu.expandNode (currentNode );
// Add a node data to dataset
Dataset_myMailBox.disableControls ();
Dataset_myMailBox.moveFirst ();
While (! Dataset_myMailBox.isLast ())
{
Record = dataset_myMailBox.getCurrent ();
Var node = new RecordTreeNode (record, currentNode. getTreeLevel (). getTreeLevel ("level_myMailBox "));
// Add a node
CurrentNode. addNode (node );
Dataset_myMailBox.moveNext ();
}
} Catch (e)
{
Alert (e. message );
} Finally {
Dataset_myMailBox.enableControls ();
}
}