Welcome Guest Search | Active Topics | Sign In | Register

Populate TreeView via Javascript? Options
Todd1561
Posted: Friday, February 26, 2016 12:04:47 PM
Rank: Newbie
Groups: Member

Joined: 10/25/2015
Posts: 3
Is it possible to populate the TreeView via javascript (likely JSON data via a jquery ajax call). If not can a single item at least be added to an existing tree via javascript?

Thanks
eo_support
Posted: Friday, February 26, 2016 4:25:15 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Unfortunately not directly. Because EO.Web.TreeView is an ASP.NET server control, in order to maintain server/client consistency a node can only be added on the server side first. It is possible for you to call this method from JavaScript to add new node:

http://www.essentialobjects.com/doc/jsdoc.public.web.treenode.populateondemand.aspx

However this also requires you to handle the server side ItemPopulate event to actually create the node on the server side. Also you can only populate each node once. So if you have already call this method on node N that created 3 child nodes A, B and C. Then it is impossible for to later add child node D since calling populateOnDemand on node N for a second time would have no effect.

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.