Hi Venuu, Check this out. Hope this help. Best regards, Marben ; create a root tree indexTree=hiCreateTree('index) ; create two tree items and append them to the root tree dow=hiCreateTreeItem('dow list("Dow Jones")) nas=hiCreateTreeItem('nas list("NASDAQ")) hiTreeAppendItem(indexTree dow) hiTreeAppendItem(indexTree nas) ; create two sub-trees dowTree=hiCreateTree('dows) nasTree=hiCreateTree('nass) ; put the two sub-trees into the two items created earlier hiItemInsertTree(dow dowTree) hiItemInsertTree(nas nasTree) ; add a few leaves for the dowTree and nasTree hiTreeAppendItem(dowTree hiCreateTreeItem('cdn list("Cadence" 80.5 1 "Strong Buy"))) hiTreeAppendItem(dowTree hiCreateTreeItem('ibm list("I.B.M." 118 3 "Hold"))) hiTreeAppendItem(nasTree hiCreateTreeItem('sunw list("Sun Micro" 27.750 4 "Sell"))) hiTreeAppendItem(nasTree hiCreateTreeItem('orcl list("Oracle" 28.925 5 "Strong Sell"))) ; create callback, which is called whenever any tree items are selected and which ; prints the selected item's description procedure( myTreeCB(name itemSymList) while(itemSymList itemSym=car(itemSymList) println(hiGetTreeItemDescription(eval(itemSym))) itemSymList=cdr(itemSymList) ) ) ; create tree table and use indexTree as the value for ?choice treeField = hiCreateTreeTable( ?name `treeField ?title "Stocks" ?titleAlignment `center ?headers list(list("Name" 125 'left `string) list("Price" 60 'left `float3) list("Rating" 45 'center `int) list("Recommendation" 125 'right) ) ?choice indexTree ?callback "myTreeCB" ) ; create a form form = hiCreateAppForm( ?name 'form ?formTitle "A Tree Sample" ?fields list( list(treeField 5:5 400:200 55) ) ?initialSize 500:250) hiDisplayForm(form)
↧