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
July 28,
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
July 29,
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
July 29,
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
August 16,
sorry, there is a typo in the above sample:
grid should be src
Gernot
August 16,
My congratulations, that was exactly my pb!
Thanks...
Gran
Gran
August 26,