:: Forum >>

Select the line from which oncontextmenu was triggered...

Hi there,

I got the contextmenu working no problem, but by default no row is selected... so I can't use the values of the selected row, and the user needs to left click and right click...

Any ideas ?
Gran
Thursday, July 28, 2005
wouldn't you be able to tell this from the event object after since it will have the div id that got clicked not 100% on this though
Friday, July 29, 2005
Well I am rather looking for something like :

obj.setEvent("oncontextmenu", function (event)
{
//HERE
obj.action("selectRow")
//OR
obj.action("click")
//HERE
event.cancelBubble = true;
event.returnValue = false;
showmenu(event);
});

BUT obj is unknown it seems...

Thx
Gran
Friday, July 29, 2005
Hi,

i had the same problem and the following solved it:

obj.setAction("showContext", showContext);

function oncontextmenu(event)
{
event.cancelBubble = true;
event.returnValue = false;
this.action("showContext");
}

Active.Templates.Text.prototype.setEvent("oncontextmenu", oncontextmenu);

function showContext(src)
{
var line = 0;
var selects = new Array();

line = grid.getProperty("item/index");
selects[0] = line;
grid.setProperty("selection/values", selects);

return false;
}
Gernot
Tuesday, August 16, 2005
sorry, there is a typo in the above sample:

grid should be src

Gernot
Tuesday, August 16, 2005
My congratulations, that was exactly my pb!

Thanks...

Gran
Gran
Friday, August 26, 2005

This topic is archived.


Back to support forum

Forum search