|
Rank: Member Groups: Member
Joined: 10/31/2007 Posts: 18
|
I'm trying to reset the selected index/item from javascript code... I can't figure it out!
Treeview name is: tvServices Looks similar to:
Order Maintenance --------------- Search --------------- Pending --------------- Shipped --------------- Archived Shipper Access --------------- View Orders --------------- Reports I would like to manually change, for instance... the 'shipped' selection to 'search'... on the client-side - (javascript)....
I don't have event tree eventinfo because I'm modifying from a grid control... so I need to reference the tree using eo_GetObject("tree")... how do I then set the selected index/node manually through javascript?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
You don't really need eventInfo. Using eo_GetObject is the right way to do it. You will get the TreeView object first, then:
1. Get your "Search" node. This can be achieved by a serial of calls to getTopGroup, getSubGroup and getItemByIndex; 2. Call the TreeView's setSelectedNode to set the selected node.
All those functions are in the online documents (also available locally as a .chm help file), so you can take a look and see what's available there.
Hope this helps.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/31/2007 Posts: 18
|
I'm sure I can work through that... thanks...
I actually create a tree's initial selected item in the pageload code-behind.... ie:
if criteria = x tvServices.Nodes.Item(1).ChildNodes(3).Selected = True endif
I guess I thought... since I know the exact index, that I could somehow call that index with javascript refrence?... I didn't see any examples in the support forum.
Thanks again... I'll figure it out.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi Ray,
That's exactly what we showed to you --- if only can take a look of where we pointed you to. getItemByIndex(x) is the client side equivalent of Items(x), getSubGroup().getItemByIndex(y) is the client side equivalent of ChildNodes(y). We believe we have pointed you exactly to where you need to be.
Thanks
|
|