11/26/2024 2:27:12 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Tree View control
Posted: 19 May 06 11:16 AM
|
fiogf49gjkf0d I'm looking for some information and very simple sample code on use of the treeview control. I have started with the code from the Opportunity Products screen however, this code is way too much. I was hoping for an example of some simple code that doesn't include using filters and setting defaults, etc. I just want to know basically how to populate the treeview when it is first opened. With the Opportunity Product treeview, I cannot decifer what I need to exclude/include, etc.
Please help... |
|
|
|
Re: Tree View control
Posted: 22 May 06 9:26 AM
|
fiogf49gjkf0d Basically what you need to do is create the tree views nodes and then looping through each node as needed populate the node with values.
To do this you could use the folowing: Dim objCon din strSQL din objRS dim objNode0
set objCon = Application.GetNewConnection strSQL = "Select account, accountid from account" set objRS = objCon.Execute (strSQL)
TreeView.Nodes.Clear Set objNode0 = TreeView.Nodes.Add(,Nothing,"Account Name") 'This is the where the first level of the tree is created. objNode0.tag = objrs.fields("accountid").value &"" with objrs while not (.eof or .bof) set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node .MoveNext Wend .Close End With Set objRS = Nothing
That is pretty much it, if you wanted to have multiple layers in the tree you would just nest another loop inside objNode0 for objNode1, etc. I did not test this code but it should give you the idea, hopefully.
|
|
|
|
Re: Tree View control
Posted: 22 May 06 5:11 PM
|
fiogf49gjkf0d A good reference for the SalesLogix controls are the Delphi counterparts (if you can decypher Delphi to a degree, or code in general really). TListView matches up with their ListView, TTreeView, etc. That's how I figured out how to manipulate a ListView but it may be that because I know a little bit about Delphi I was able to convert the examples I had to something functional in VBScript. The biggest issue is that you have to set objects as noted by the Set objNode0 = TreeView.Nodes.Add() function. You need to do the same when manipulating a ListView.
Then again both controls are related so they would require the same basic structure to function. I think a TreeView is a ListView on steroids or I may have that backwards. |
|
|
|
Re: Tree View control
Posted: 08 Sep 06 2:39 PM
|
fiogf49gjkf0d the tested version of that script :
----------------------------------------- Dim objCon dim strSQL dim objRS dim objNode0 dim objNode
set objCon = Application.GetNewConnection strSQL = "Select top 10 account, accountid from account" set objRS = objCon.Execute (strSQL)
TreeView.Nodes.Clear Set objNode0 = TreeView.Nodes.Add(Nothing,"Account Name") 'This is the where the first level of the tree is created. objNode0.tag = objrs.fields("accountid").value &"" with objrs while not (.eof or .bof) set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node .MoveNext Wend .Close End With Set objRS = Nothing
-----------------------------------------
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|