Welcome Guest Search | Active Topics | Sign In | Register

TreeView Options
Ray Bradley
Posted: Friday, March 14, 2008 10:27:45 AM
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?



eo_support
Posted: Friday, March 14, 2008 10:36:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
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
Ray Bradley
Posted: Friday, March 14, 2008 10:45:31 AM
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.
eo_support
Posted: Friday, March 14, 2008 10:56:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.