JavaFX: Disable multiple rows in TableView based on other TableView

前端 未结 1 1852
没有蜡笔的小新
没有蜡笔的小新 2021-01-25 11:46

I\'m creating an application in JavaFx. Right now I have two tableviews next to each other:

---------------------------------------------------------------------         


        
1条回答
  •  深忆病人
    2021-01-25 12:00

    I'm not quite sure of the logic you're wanting, but if your row factory is attached to table 1, and you are disabling the row when the item is present in table 2, do:

    row.disableProperty().bind(Bindings.createBooleanBinding(() -> 
        table2.getItems().contains(row.getItem()), table2.getItems(), row.itemProperty()));
    

    0 讨论(0)
提交回复
热议问题