:: Forum >>
Right Click Context Menu in Firefox
Hello,
I've been using the code found here:
http://www.activewidgets.com/javascript.forum.12947.7/how-to-properly-set-oncontextmenu.html to get right click context menus to work. So far they seem to work fine in IE, but not in Firefox. Firefox seems to require a double right click action to pop the browsers context menu within the grid, but it doesnt display the menu that I made. IE will display both on top of each other. I have some code to stop the browsers context menu, but I have commented it out for the time being so it is not a factor in the problem.
I'm also trying to do the same thing using a list box. It works the same, but one thing I noticed is that with a grid the row is selected when using the right mouse button as well. When right clicking inside the list box the row is not selected. Is there any way to select the row in a listbox on a right click event?
If anyone has any insight into these problems please let me know.
Thanks.
Aaron
Tuesday, December 2, 2008
Anthony
Tuesday, December 2, 2008
Anthony,
Thanks for your help here, but I do not see how the links you provided or the suggestion of using a Firefox Addon would help me eliminate the need for the double right click issue. This is only only necessary inside the AW Grid.
If you take a look at the link I provided in my original post, the idea is to pop a custom formated HTML box when the right click event occurs. I do not want to add to the browsers menu, but replace it entirely.
As I said, this works great in IE using the javascript that Alex gave in that same link. For some reason Firefox does not work the same. Why? Is it possible? How?
Thanks.
Aaron
Wednesday, December 3, 2008
Anthony
Wednesday, December 3, 2008
Anthony,
Any idea on how to make a right click event select the row in a list box giving it the same functionality as a left click?
Thanks,
Aaron
Wednesday, December 3, 2008
Anthony,
Nevermind that last coment. I took a step back, and comented out the context menu code I'm playing with. Turns out a list box already does perform the same selection action on both a left and right click.
Thanks again,
Aaron
Wednesday, December 3, 2008
Ok, scratch that...I'm in browser compatability hell now. The code below, in Firefox, will select a row on a right and left click. In Internet Explorer, it will only select the row with a left click.
var lstFiles= new AW.UI.List;
lstFiles.setId("lstFiles");
lstFiles.setItemText(function(i){return arrayFiles[i][0]});
lstFiles.setItemCount(arrayFiles.length);
lstFiles.refresh();
Aaron
Wednesday, December 3, 2008
Anthony
Thursday, December 4, 2008
obj.onItemMouseUp = function(event, index){
if (event.button == 2 ){
var x = obj.getSelectedItems();
x.lenght>0?x.push([index]):x=[index];
obj.setSelectedItems(x);
obj.refresh();
}
}
Thursday, December 4, 2008
This topic is archived.
Back to support forum
Forum search