Solved

jquery context menu and simple tree

Posted on 2009-07-09
1
1,209 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
ID: 24815018
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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)

920 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

17 Experts available now in Live!

Get 1:1 Help Now