Purpose: Build a HTML/JavaScript hierarchical tree. Generate data script for the tree. A data script for trees is always an array of treeitems which in turn comprise four values. These are the level, a 0 or a 1 for either item/folder, the title and the URL (link to item). The data script is used in conjuction with the _dsmScript_navtree/makeTree script which uses the data script to effect the tree in HTML bu a series of document.write operations.

Return TypeFunction nameArguments
hzEcodehdsNavtree::ExportDataScript(hzChain&,)

Declared in file: hzDissemino.h
Defined in file : hdsNavtree.cpp

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:Return E_NODATA 5:items items items 6:Return E_OK

Function body:

hzEcode hdsNavtree::ExportDataScript (hzChain& J)
{
   //  Purpose: Build a HTML/JavaScript hierarchical tree.
   //  
   //  Generate data script for the tree. A data script for trees is always an array of treeitems which in turn comprise four values. These are the
   //  level, a 0 or a 1 for either item/folder, the title and the URL (link to item).
   //  
   //  The data script is used in conjuction with the _dsmScript_navtree/makeTree script which uses the data script to effect the tree in HTML bu a series of
   //  document.write operations.
   //  
   //  Arguments: 1) J The chain in which tree is being built
   //  
   //  Returns: E_NODATA If the tree is empty
   //     E_OK  If the tree is exported to the supplied chain
   _hzfunc("hdsNavtree::ExportDataScript") ;
   if (!this)
       hzexit(E_CORRUPT, "No instance") ;
   if (!m_ItemsByName.Count())
       return E_NODATA ;
   hzString    root ;  //  Blank start
   J << "var ntX=new Array();\nntX=[" ;
   _procTreeitem(J, root) ;
   J << "\n\t];\n" ;
   //  threadLog("BEGIN NAV\n") ;
   //  threadLog(J) ;
   //  threadLog("ENDF NAV\n") ;
   return E_OK ;
}