how to add column of ClickableTextCells to cellTable

后端 未结 3 541
挽巷
挽巷 2021-01-12 23:17

hi all i need a simple example show me how to add column of ClickableTextCells to cellTable

thanks.

3条回答
  •  误落风尘
    2021-01-12 23:50

    Create a Column overriding the onBrowserEvent method.

    Like this:

    new Column(new TextCell()) {
        @Override
        public String getValue(T object) {
            return object.getProperty();
        }
    
        @Override
        public void onBrowserEvent(Context context, Element elem, T object, NativeEvent event) {
            // TODO You can check which event you want to catch
            Window.open("http://www.stackoverflow.com", "StackOverFlow", "");
        }
    };
    

提交回复
热议问题