dynaTree looping
Hi Guys
I'm using the below to populate a tree to just show the root with a folder icon but whenever I click on a folder it loops back to the original folder, how can I disable the root folder from expanding to the next, I only want to show the main opened root folder and not to go any further?
Method GetTreeInfo(pRoot As %String, Output pTree, ByRef pParms) As %Status
{
Set MyId=..GetId,pos=1
&Sql(Select Name,ID into :name,:id from MSDS_COM.Loc where Parent=:MyId)
Set:SQLCODE (name,id)=""
Set pTree(0,"ch",1) = ""
Set pTree(1) = $LB(name,id,1,"","")
Quit $$$OK
}
.png)
Thanks
Product version: Ensemble 2018.1
Discussion (1)1
Comments
Try this:
ClassMethod GetTreeInfo(
pRoot As %String,
Output pTree,
ByRef pParms) As %Status
{
Set MyId=..GetId,pos=1
&Sql(Select Name,ID into :name,:id from MSDS_COM.Loc where Parent=:MyId)
Set:SQLCODE (name,id)=""
if pRoot=""
{
Set pTree(0,"ch",1) = ""
Set pTree(1) = $LB(name,id,1,"","")
}
Quit $$$OK
}For further examples, see the class ZENTest.DynaTreeTest in the SAMPLES namespace.