1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    96
    Vote Rating
    1
    r4nd7263 is on a distinguished road

      0  

    Default Conditionally render ButtonCell

    I'd like to show ButtonCell only on certain rows in a grid.

    I tried

    Code:
    final ButtonCell<MyModel> btn = new ButtonCell<MyModel>() {
                @Override
                public void render(com.google.gwt.cell.client.Cell.Context context, MyModel value, SafeHtmlBuilder sb) {
                    boolean condMet = ...
                    if (condMet) {
                        super.render(context, value, sb);
                    }
                }
            };
    colCfg.setCell(btn);
    which works in some browsers, but not all. Firefox and IE8 randomly throw javascript error when I mouse over a button.

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default

    You need to also add code to ignore events fired. I think the method you want to override is called onBrowserEvent(...).

Thread Participants: 1