Solved

jquery context menu and simple tree

Posted on 2009-07-09
1
1,206 Views
Last Modified: 2012-05-07
I am having troubble with getting the context menu to work with the simple tree.
It will work after the second right click has been made.

How can i make this work on the first right click?


I think it will be something todo with enabling context menu first and re-enabling when the click is made.
$('.content_Text_files').load('ajax/webpage_manage_load.php', function(){
 

	simpleTreeCollection = $('.simpleTree').simpleTree({

		autoclose: false,

		drag: false,

		afterClick:function(node){				

			thisClick = $('span:first',node).parent().attr('id');

			  makeMenu(3);		

			  widgetClicksLoad('widgets/ajax/load_list.php?pageID='+ thisClick)

			  $('#widgetProd').val('');

			

			  $('#widgetCat').val(thisClick);

			

		},

		afterContextMenu:function(node){
 

		$('span:first',node).contextMenu({menu: 'myMenu'}, function(action, el, pos) { 

		TreeMenu(action,$('span:first',node).parent().attr('id'));

		}); 
 

		},	

		animate:true

	});	

});

Open in new window

0
Comment
Question by:jimbinho
1 Comment
 

Accepted Solution

by:
jimbinho earned 0 total points
Comment Utility
The key is

          $('.simpleTree span').contextMenu({menu: 'myMenu'}, function(action, el, pos) {
                  TreeMenu(action,$(el).parent().attr('id'));
            });


Thanks for the help! :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now