Solved

jquery context menu and simple tree

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

840 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