How to add clickhandler on ImageCell in GWT CellTable?

前端 未结 8 1429
再見小時候
再見小時候 2021-02-06 04:01

I have tried this but didn\'t work

Column imageColumn = new Column(new ImageCell()) {
       @Override
             


        
8条回答
  •  时光取名叫无心
    2021-02-06 04:35

    I did something similar mixing a Button cell with the renderer from an ImageCell....

        ButtonCell bc = new ButtonCell() {
            @Override
            public void render(Context context, SafeHtml data, SafeHtmlBuilder sb) {
                if (data != null) {
                    ImageResource icon = Icons.BUNDLE.pieChart();
                    SafeHtml html = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(icon).getHTML());
                    sb.append(html);
                }
            }
        };
    

    You get the idea. The only problem is that it does not display the "hand" icon when you hover over it.... likely it can be fixed by setting the CSS.

提交回复
热议问题