?
Solved

jquery context menu and simple tree

Posted on 2009-07-09
1
Medium Priority
?
1,237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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 purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Suggested Courses

765 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