[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

jquery context menu and simple tree

Posted on 2009-07-09
1
Medium Priority
?
1,241 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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

650 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