Page 1 of 1 1
Topic Options
#120033 - 2004-05-24 01:08 PM Treeview example
Rory Daniels Offline
Getting the hang of it

Registered: 2003-02-25
Posts: 64
Loc: Bristol, UK
Doe's anybody have an example of retrieving a nodes details within the the treeview object?

Thankx

Rory

Top
#120034 - 2004-05-24 01:15 PM Re: Treeview example
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
wonder what details would you be referring to.
afaik, there is only a collection of childnodes and the node's name.
_________________________
!

download KiXnet

Top
#120035 - 2004-05-24 01:31 PM Re: Treeview example
Rory Daniels Offline
Getting the hang of it

Registered: 2003-02-25
Posts: 64
Loc: Bristol, UK
Sorry just started playing with this code.
Not quite sure how to get the selected node?

Rory

Code:
 $TreeView = $Form.TreeView()
$TreeView.Width = $Form.ClientWidth / 4
$TreeView.Dock = 3

$MachineArray=MPW002841,MPW002842,MPW002843,MPW002844,MPW002845,MPW002846,MPW002847,MPW002848,MPW002849,MPW002850
$RootNode = $TreeView.Nodes.Add("Machine List",45,46)

For Each $Machine in $MachineArray
$MachineNode = $RootNode.Nodes.Add("$Machine",45,46)
$MachineNode.tag=$Machine
$Logs = $MachineNode.Nodes.Add("Logs",45,46)
$Audit = $Logs.Nodes.Add("Audit",45,46)
$Diagnostic = $Logs.Nodes.Add("Diagnostic",45,46)
$Distribution = $Logs.Nodes.Add("Distribution",45,46)
$Installation = $Logs.Nodes.Add("Installation",45,46)
$Services = $MachineNode.Nodes.Add("Services",45,46)
$CNCService = $Services.Nodes.Add("NSPIS CNC Software Distribution",45,46)
$SU = $Services.Nodes.Add("SU",45,46)
$TimeSync = $Services.Nodes.Add("TimeSync",45,46)
Next


Top
#120036 - 2004-05-24 01:51 PM Re: Treeview example
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
$treeview.onclick="$$treeview.selectednode.text ?"
_________________________
!

download KiXnet

Top
#120037 - 2004-05-24 02:21 PM Re: Treeview example
Rory Daniels Offline
Getting the hang of it

Registered: 2003-02-25
Posts: 64
Loc: Bristol, UK
Thankx the code

Code:
 $treeview.selectednode.text 



Works fine. Is there any more detailed documentation other than the Kixforms Object Reference available on treeview. Currently I can get the parent of the node but I am not sure how to get the parents parent and I dont want to be bothering you all the time when I could be working it out myself.

Rory

Top
#120038 - 2004-05-24 02:32 PM Re: Treeview example
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no, there is no "real" documentation.
the CHM is getting little overflowing already, so it's usability has dropped significantly.
you could check on msdn, as the same rules basically should work in KF (not all working though)

as far as I know, what you are looking actually is the path-property.
instead of browsing each parent to the root, you could get with one call all parents of the node.

anyways, IIRC, the path is not working in KF yet.
_________________________
!

download KiXnet

Top
#120039 - 2004-05-24 02:53 PM Re: Treeview example
Rory Daniels Offline
Getting the hang of it

Registered: 2003-02-25
Posts: 64
Loc: Bristol, UK
Tankx for your time. Guess I'll have to wait.

Rory

Top
#120040 - 2004-05-24 02:56 PM Re: Treeview example
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
If you know how deeply "nested" you are in the tree, you can get the parents parent of a node by addressing it directly, example:

$GrandParentNode = $Node.Parent.Parent


Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org