We help IT Professionals succeed at work.

copy node to another treeview node

965 Views
Last Modified: 2013-12-17
hello i want to copy node to another treenode using javascript ..

example:

when i create node in treeview1 using javascript i want add that node instantly to the another treeview .. how could i .. do that ..

suppose:

their are 2 treeview: treeview1 and treeview2

when i add node on treeview1 using javascript then that node is copy as it is to the treeview2 .. please help me .. !! thanks..
Comment
Watch Question

Miguel OzSenior Software Engineer
CERTIFIED EXPERT
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
@mas_oz2003: man i have no xml file i just right click and add the node via javascript their is no function of clonenode in javascript .. okz

and its a xml load events..

okz


CERTIFIED EXPERT

Commented:
you can try create a new node as
http://viralpatel.net/blogs/2009/01/dynamic-add-textbox-input-button-radio-element-html-javascript.html
and using node attributes and method reference on
https://developer.mozilla.org/En/DOM/Node

some more reference https://developer.mozilla.org/En/DOM/Element
should be not difficult

Author

Commented:
no its helpful fsze88...


Author

Commented:
please help me any expert .. !!
CERTIFIED EXPERT
Author of the Year 2009

Commented:
AVARICESOFT,
Javascript has no "tree" object nor does standard HTML.
I think that you might be working with the ASP.NET TreeView control.  Is that true?  If so, the documentation for it is quite complete.  Check here:
    TreeView Control (Visual Studio)
    http://msdn.microsoft.com/en-us/library/d4fz6xk2(VS.80).aspx

Author

Commented:
sir i use asp.net controls using telerik rad tools ... but u tell me the asp.net treeview.. because asp.net treeview and telerik radtools have same methods and properties. kindly tell me some javascript which copy the nodes of 1 treeview node to another treeview node.. thats all ..
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
.NET isn't my expertise but Javascript really isn't what you should use for this.  If you need to add a "node" and are using a control to make the "tree" then you should use the server code to add it.  Does the control have a method you can use to add a node?  If so then use it with a client event to call the server code to fire that method.  If there isn't one then it still seems it would be easier to add the node using .NET or something in that control.  To use Javascript you would need to just work with the DOM which could be hard and even different, depending on the browser.  If you must use Javascript then the Javascript experts need to see the html source (NOT the .NET code) to see what html you have in that section.  If the page is involved then please just provide the basics for that part of it.  My recommendation though is to find a solution in .NET with the control you are using.

bol

Author

Commented:
i want only to clone the first tree to the second tree via javascript thats all my query .. its to simple ... i use asp.net and use asp.net treeview control.. okz ..

and i need only clone or copy the exact tree via javascript to another tree... thats all ...

please expert help me..
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
I would love to help you but you aren't providing me the info I asked for and need to give you the Javascript.  Mentioning you are using a control doesn't tell me what the browser gets or the html source.  In my previous comment I mentioned how you could get it but there was no response to that part of my post.

If you just can't/won't provide anything else then you may want to use the "Request Attenion" link again or start a new question.  Because of the age of this it probably won't attract new experts without some help from the moderators or closing this and opening a new one.

bol
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.