Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-18-2009, 10:44 PM   PM User | #1
javaguy1007
New Coder

 
Join Date: Mar 2009
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
javaguy1007 is an unknown quantity at this point
DOJO help

Hi Frnds

I am new to dojo. I am trying to implement multiple selection of dojo tree nodes and copy them to anothe list box. Can u help me how to implement this

jsp code
Code:
<button dojoType="button" onClick="remove_elem(document.getElementById('myname').selectedIndex);" > < </button>
			</td>
			<td>
			   <button dojoType="button" onClick="myfunction();" > > </button>
			</td>
			<td>
				<select name="myname" id="myname"   multiple="multiple" style="height: 200px; width: 240px; overflow: auto">
				
				</select>
jscode
Code:
function myfunction()
    {
	 var node = dojo.widget.byId('tree').selectedNode;
      var strText = node.title;
      var fullpath;
	  if(node.parent.title == "Rootnode"){
		  fullpath = node.title;
	  }
		  else if (node.parent.parent.title == "Rootnode")
		  {
			  fullpath = node.parent.title+"//"+node.title;
		  } else if (node.parent.parent.title == "Rootnode")
		  {
			  fullpath = node.parent.title + "//" + node.parent.title + "//" + node.title;
		  } else if (node.parent.parent.parent.title == "Rootnode")
		  {
			  fullpath = node.parent.parent.title + "//" + node.parent.title + "//" + node.title;
		  }else if (node.parent.parent.parent.parent.title == "Rootnode")
		  {
			  fullpath =  node.parent.parent.parent.title + "//" + node.parent.parent.title + "//" + node.parent.title + "//" + node.title;
		  }else if (node.parent.parent.parent.parent.parent.title == "Rootnode")
		  {
			  fullpath = node.parent.parent.parent.parent.title + "//" + node.parent.parent.parent.title + "//" + node.parent.parent.title + "//" + node.parent.title + "//" + node.title;
		  }
       var len = document.getElementById('myname').length;
       
	   if (node){
		   
		    document.getElementById('myname').options[len] = new Option(strText,fullpath); 
		    
		   	}else{ alert(" Please Select the node"); }
    }
javaguy1007 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:10 AM.


Advertisement
Log in to turn off these ads.