|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
I use the ASP.NET TreeView control. It works, but it generates so much markup that the resulting page is TEN TIMES larger than what the EO.Web.TreeView control produces. So I'm very interested in purchasing the kit. I'm running into difficulty figuring out how to implement the specifics.
Here's how my code runs right now: - user selects criteria for which hierarchy they want to view - page builds Real.Hierarchy in code, represents a COPY of the hierarchy as Copy.Hierarchy (Copy.TreeNode) - user clicks the Copy.TreeNode they are interested in - intermediary code locates the Real.Node - a "property pane" displays information about the Real.Node - user can update information in the property pane - when the user navigates away from the Node (TreeView_SelectedNodeChanged), the Real.TreeNode is updated
I don't see a similar "lost_focus" event in your API, though. Any suggestions on how to approach this? I'm looking forward to learning AJAX, but I'm paid by the hour so I have to be fair by asking for a non-AJAX answer first, if it exists.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We can only answer your question about the TreeView, we won't be looking into your actual business scenario/specs and devise/suggest a plan that works for you. Those would fall into consulting work instead of tech support.
Based on the information you provided, you will want to look into whether you want to do it based on client side interface or server side interface first. Both have advantages/disadvantages/limitations. If you are familiar with both server side and client side coding, then it should not be difficult for you to use both; If you are not familiar with JavaScript, then I would recommend you to start with server side interface first.
The basic server interface primarily focuses on two things:
1. How to build/update your TreeView; 2. How to response ItemClick event;
You can go through the docs and samples to see if you can see how those works and let us know if you have any questions. Please keep in mind that our support is for our product only. For example, if you ask "How to update a Panel when user clicks a TreeNode", we will tell you how to handle the TreeView's ItemClick event only. We will not be telling you how to update a Panel or how to associate the code that update the Panel with the event handler. If you ask “How to update a TreeNode when user clicks a button”, we will only tell you how to update a TreeNode, you will need to take care of the rest.
Once you are familiar with the server side event, you can go further to the client API if you need to.
I am not sure what you mean by "lost focus" event though. If you are looking for selected node changed event, you can handle ItemClick event.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
Not asking for planning on the business side, kinda stunned you could reach that conclusion. Wow. Then again, I have no idea what other folks ask for, so maybe it happens all the time. Tell you what -- I'll start a new thread for the Psychic Consulting Hotline. :)
I'm pretty sure ItemClick will handle my needs for selecting which node to display, that's great. As for knowing when to repopulate an object, I think I'm just going to monitor Page_Load -- if ANYTHING causes a postback, I'll update. Simple.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Sorry that we might have offended you. It's just a disclaimer that we usually put forward to avoid giving our users wrong expectations. Because your original post includes many reference to your own code logics (such as "such as "page builds Real.Hierarchy in code, represents a COPY of the hierarchy as Copy.Hierarchy", "intermediary code locates the Real.Node", etc), we wanted to be that we will not be looking into these logics. We understand that you may just provide it as extra information so that we can see your scenario clearly, but we just wanted to avoid any possible confusion so we chose to clearly tell you what we do and what we do not.
Yes. ItemClick event should do selecting node for you. As to repopulating, you can do it inside Page_Load or any other server event, but should only do it when necessary. If you do it everytime then you will have problem with handling ItemClick event because ItemClick event is a postback, so if you change the TreeView when ItemClick is about to fire you will almost certainly run into problem.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
eo_support wrote:Sorry that we might have offended you... but we just wanted to avoid any possible confusion so we chose to clearly tell you what we do and what we do not. I understand completely, no problem. eo_support wrote:... because ItemClick event is a postback, so if you change the TreeView when ItemClick is about to fire you will almost certainly run into problem. Good point -- thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
You are welcome. Please feel free to let us know if you have any other questions.
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
I am generating nodes in server-side code. I want to have the selected node stand out. I have a CSS style already created, but I don't see how to apply it.
Can I use CSS? Do I have to create instances of EO.Web.ElementStyle for "selected" and "normal", then pass both instances to each node I create?
Where in the documentation is this discussed? I'll take a wander through the page you identify.
Thanks; D
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, Yes. You can use CSS. Here is what you will want to take a look: http://doc.essentialobjects.com/library/1/menucommon/styleandappearance/menu_item_styles.aspxIf you do not wish to go over all the details, you can also use any of the build-in templates. You can copy them directly from our sample pages. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
How do I turn off "animations"? When I click a node it takes a fraction of a second to expand the node, and I'd rather it immediately call the Postback.
Thanks; D
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
The callback does occur immediately regardless. It's just while the callback is starting, the animations also tries to start.
If you wish to turn off the animation, you can turn off "expand on click" by setting the TreeView's ExpandOnClick property to false. Once you do that, clicking a node will no longer automatically expand it, thus no animation will occur. If you do want the node to expand on click, you can set the node's Expanded to true in your ItemClick event handler.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2010 Posts: 8
|
I'll leave it alone, then. I want to move to AJAX soon, and the animation will serve as additional feedback that something is happening.
Thanks; D
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Please feel free to let us know if you have any other questions.
Thanks
|
|