Results 1 to 2 of 2

Thread: Conditionally render ButtonCell

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    96
    Vote Rating
    1
      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
      0  

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •