Patching AW.UI modues itself
Hi,
When I needed to all the Input box to behave the same way i just used AW.UI.Input.protoype = ... and it worked like a hell. All the input boxes was behaving the way I needed with no more need to patch each one itself.
Now i tried to implement Context menu to all the grids in my app using the same way... Tried to Patch AW.UI.Grid.prototype... But I got the error, that the object does not have this property or method...
What am I doing wrong ?
When I needed to all the Input box to behave the same way i just used AW.UI.Input.protoype = ... and it worked like a hell. All the input boxes was behaving the way I needed with no more need to patch each one itself.
Now i tried to implement Context menu to all the grids in my app using the same way... Tried to Patch AW.UI.Grid.prototype... But I got the error, that the object does not have this property or method...
What am I doing wrong ?
// html event handler translates to grid events
oncontextmenu = function(event){
this.raiseEvent("onHeaderContextMenu");
}
// assign html event handler to header template
//AW.UI.Grid.prototype.getHeaderTemplate().setEvent("oncontextmenu", oncontextmenu);
// assign grid event handler
AW.UI.Grid.prototype.onHeaderContextMenu = function(event, col){
var contextMenuContent = '';
contextMenuContent += '<a class="menuItem" href="javascript:customFunctionA('+row+')"><strong>Custom Function A</strong></a>';
contextMenuContent += '<a class="menuItem" href="javascript:customFunctionB()">Custom Function B</a>';
contextMenuContent += '<div class="menuItemSep"></div>';
contextMenuContent += '<a class="menuItem" href="javascript:customFunctionC()">Custom Function C</a>';
writeContextMenu(contextMenuContent);
showContextMenu(event);
}
ASJ
August 1,