Solved

jquery context menu and simple tree

Posted on 2009-07-09
1
1,212 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

810 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