Hi Isomorphic
I am in a problem when try to show hide context menu in right click on a listgrid.
My aim is :
When grid contain at least one row, on right mouse click on row, context menu will be visible to the user but when user right mouse down outside grid row but with in grid body,no context menu will be visible to user. (See attached image)
But problem is, once the context menu is visible to the user, on grid row right mouse click,it is not invisible even when user click outside the grid row with in grid body.
How to solve this problem ??
If possible please tell me the way to do.
I have add this code:
Menu stationMenu=new Menu()
stationMenu.setWidth(150);
MenuItem CONTEXT_MENU_Station = new MenuItem();
CONTEXT_MENU_Station .setTitle("Station Edit");
stationMenu.setItems(CONTEXT_MENU_Station );
Grid1.addRowContextClickHandler(new owContextClickHandler() {
@Override
public void onRowContextClick(RowContextClickEvent event) {
if(event.getRowNum()>=0 && event.getColNum()==0)
{
Grid1.setContextMenu(stationMenu);
}
else
{
Grid1.setContextMenu(null);
event.cancel();
}
}
});
Grid1.addVisibilityChangedHandler(new isibilityChangedHandler() {
@Override
public void onVisibilityChanged(VisibilityChangedEvent event) {
if(event.getIsVisible())
{
Grid1.setContextMenu(null);
}
}
});
I am using SmartClient Version: v8.3_2012-11-20/PowerEdition Deployment (built 2012-11-20)
Mozilla 25.0.1
Chrome Version 34.0.1847.137 m
Window 7
I am in a problem when try to show hide context menu in right click on a listgrid.
My aim is :
When grid contain at least one row, on right mouse click on row, context menu will be visible to the user but when user right mouse down outside grid row but with in grid body,no context menu will be visible to user. (See attached image)
But problem is, once the context menu is visible to the user, on grid row right mouse click,it is not invisible even when user click outside the grid row with in grid body.
How to solve this problem ??
If possible please tell me the way to do.
I have add this code:
Menu stationMenu=new Menu()
stationMenu.setWidth(150);
MenuItem CONTEXT_MENU_Station = new MenuItem();
CONTEXT_MENU_Station .setTitle("Station Edit");
stationMenu.setItems(CONTEXT_MENU_Station );
Grid1.addRowContextClickHandler(new owContextClickHandler() {
@Override
public void onRowContextClick(RowContextClickEvent event) {
if(event.getRowNum()>=0 && event.getColNum()==0)
{
Grid1.setContextMenu(stationMenu);
}
else
{
Grid1.setContextMenu(null);
event.cancel();
}
}
});
Grid1.addVisibilityChangedHandler(new isibilityChangedHandler() {
@Override
public void onVisibilityChanged(VisibilityChangedEvent event) {
if(event.getIsVisible())
{
Grid1.setContextMenu(null);
}
}
});
I am using SmartClient Version: v8.3_2012-11-20/PowerEdition Deployment (built 2012-11-20)
Mozilla 25.0.1
Chrome Version 34.0.1847.137 m
Window 7