:: Forum >>

Custom grid control with popups

I've created a customised version of the AW grid and I'm trying to create a custom control containing the grid, a input box underneath and two popup menus.

I can get the grid and the input box to display together with the grid above the input box. However when I right click on the header (this should make one of the popup menus appear by moving it off the screen onto the screen), the popup menu does not appear.

I wondered if either the custom control or the grid itself wasn't refreshing, so I added in calls to grid.refresh() and this.$owner.refresh(). However the popup menu still didn't appear.

Anyone got any suggestions? I can post a stripped version of the code, if this would be helpful.

Thanks in advance
Helen Williamson
Friday, January 20, 2006
did you put an alert into the function that moves the popup menu just to make sure that it is still getting called? I would put in a coupld to make sure that every line in that function is still working. Also, make sure that the z-index of the popup menu is a high number to make sure that it ALWAYS appears on top of everything else.
Jim Hunter
Friday, January 20, 2006
Sorry Jim, but what is the z-index of a control? What property should I be looking at (i.e. with a getStyle()) to get hold of this?

Thanks again
Helen Williamson
Tuesday, January 24, 2006
Helen,

here is an example of right click event handler for the grid headers -

var obj = new AW.UI.Grid;
obj.setCellText("cell");
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);

// html event handler translates to grid events
function oncontextmenu(event){
    this.raiseEvent("onHeaderContextMenu");
}

// assign html event handler to header template
obj.getHeaderTemplate().setEvent("oncontextmenu", oncontextmenu);


// assign grid event handler
obj.onHeaderContextMenu = function(event, col){
    alert("context menu event - col:" + col);
}

document.write(obj);
Alex (ActiveWidgets)
Tuesday, January 24, 2006
Thanks Alex. I changed my event handler from onmousedown to oncontextmenu. However even after that, the popup menu still wan't being displayed.

I even changed the code, so that the popup would be displayed when the grid is initially painted. The popup appeared when the screen loaded, but after clicking on the header, the popup didn't move.

Is there some kind of refresh that I should be trying? I've tried filter.refresh() (this is my popup menu), grid.refresh (obviously my grid) and this.$owner.refresh()

Thanks again
Helen Williamson
Tuesday, January 24, 2006
Hey Alex

Thanks for the code. However it does not work on firefox - would you have any onheadercontextmenu code that works on both ie and firefox.
cipher
Wednesday, August 23, 2006

This topic is archived.


Back to support forum

Forum search