3.0.5

ContextMenu for RowHeaders

I have implmeneted a contextmenu that works for main data cells but does not seem to get fired when right clicking on the row headers/column headers. Below is the code I have used.

Any ideas??

//set the action to handle the contextmenu
function oncontextmenu(event)
{
    event.cancelBubble = true;
    event.returnValue = false;
    this.action("contextmenu");
}

// assign the event handler to the cell template prototype
Active.Templates.Text.prototype.setEvent("oncontextmenu", oncontextmenu);

// create action handler for the right click context menu
gridObj.setAction("contextmenu", function(src) 
    {
        if ( gridDataLinks.length != null && gridDataLinks.length != 0 ) {
            //load the context menu from gridDataLinks
            var link = src.getProperty("item/link");
            return eval (link);
        } else {
            //there is no context menu
            return false;
        }
    } 
);
Dean
June 16,
Headers use Active.Templates.Item and Active.Templates.Header templates. You have to assign the event handler there as well. Or just to Active.System.Template (base class).
Alex (ActiveWidgets)
June 17,
Dean, can you post the full code?

thnx
Hugo Abreu
September 13,

This topic is archived.

See also:


Back to support forum