Text in TextButtonCell disappears when its line is selected

I have a DataGrid and I am setting a column with a TextButtonCell .

If nothing is selected, everything is in order.

enter image description here

But as soon as I select a line, the text on the button disappears.

enter image description here

How can I stop the text on a button disappearing?

Edit

Below is the code I created in this column:

  Column<Publication, String> buttonColumn = new Column<Publication, String>(new TextButtonCell()) { @Override public String getValue(Publication pub) { ((TextButtonCell)getCell()).setEnabled(pub.isPublishable()); return "Publish"; } }; buttonColumn.setFieldUpdater(new FieldUpdater<Publication, String>() { @Override public void update(int index, Publication pub, String value) { publish(pub); } }); pubDG.addColumn(buttonColumn); 
+4
source share
2 answers

Do not use the selection model if possible. Maybe this will solve your problem.

+1
source

If you want to use the selection model, redefine css to change the text color of the selected row, then you can see the text of the text button.

0
source

Source: https://habr.com/ru/post/1443671/


All Articles