Announcement

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

    Cell Context Menu Items

    I'm having trouble getting the getCellContextMenuItems() method called. Here's a reproducible sample, the GWT.log() method below never gets called for me:

    Code:
        public void onModuleLoad() {
            final ListGrid listGrid = new ListGrid(DataSource.get(DSConst.OpeningSQL.DATASOURCE)) {
    
                @Override
                public MenuItem[] getCellContextMenuItems(final Integer record, final Integer rowNum, final Integer colNum) {
                    GWT.log("I GOT CALLED");
                    return null;
                }
            };
            listGrid.setShowCellContextMenus(true);
    
            listGrid.setWidth100();
            listGrid.setHeight100();
            listGrid.setAutoFetchData(true);
            listGrid.draw();
        }
    I'm using version: Isomorphic SmartClient/SmartGWT Framework (v12.1p_2020-04-23/Enterprise Deployment 2020-04-23) - Initialization Complete

    Maybe I'm doing something wrong, but the above looks correct as far as I can tell.

    #2
    This is not marked as an override point (not every method can be an override point in SmartGWT, unlike in SmartClient).

    It would be simplest to just use the cellContextMenu event and call getCellContextMenuItems() if you actually want the default items - they are almost like placeholders, we're not aware of anyone actually wanting them. The cell-level features are really there more for the CubeGrid subclass.

    Comment


      #3
      Gotcha, I was able to get it to work with the event instead. Thanks

      Comment

      Working...
      X