Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    the Menu of the ListGrid has no affect in firefox

    hello ,everyone!
    I encounter a problem .
    the Menu of the ListGrid has no affect in firefox when RowContextClickEvent is Happening.

    problem:

    in firefox ,it has default ContextClickEvent,
    in smartGWT, it has another ContextClickEvent
    the menu both show at the same time when RowContextClickEvent is Happening,
    and the ContextClickEvent of the firefox coverages the smartGWT.

    but I want only show the menu of the smartGWT,not is firefox.
    what can I do?
    help!

    my configuration :
    gwt 1.5.3
    smartgwt
    centos Firefox/3.0.2

    sample code:
    use the AutofitNewRecordsSample , I add the RowContextClickHandler .

    countryGrid.addRowContextClickHandler(new RowContextClickHandler(){
    public void onRowContextClick(RowContextClickEvent event) {
    Menu menu =new Menu();
    MenuItem item =new MenuItem();
    item.setTitle("refresh");
    menu.addItem(item);
    menu.showContextMenu();
    }

    });



    thanks!

    #2
    You need to call event.cancel() in order to prevent the default browser context menu from showing.

    Try right clicking on the grid in this sample. Also view the source of the sample.

    Here's the relevant code

    Code:
    countryGrid.addCellContextClickHandler(new CellContextClickHandler() {  
        public void onCellContextClick(CellContextClickEvent event) {  
            sayCellEvent(countryGrid, "Context-clicked", (CountryRecord) event.getRecord(), event.getColNum());  
            event.cancel();  
        }  
    });

    Comment


      #3
      thanks sjivan,

      Comment

      Working...
      X