0

I have a JavaFX TableView, filled with an Observable ArrayList of objects. I want to disable certain objects in the TableView that have certain properties. I still want these objects displayed, but would like them to be grayed-out or disabled. How would I do this? I do not have the index of the items I want to disable.

MattHampel
  • 29
  • 6
  • Possible duplicate of [JavaFX: How to disable a row in a TableView?](http://stackoverflow.com/questions/26607144/javafx-how-to-disable-a-row-in-a-tableview) – DVarga Jul 01 '16 at 19:53
  • The above suggestion relies on having the index of the item I am disabling, which I do not have. – MattHampel Jul 01 '16 at 20:09
  • Possible duplicate of http://stackoverflow.com/questions/37010431/is-it-possible-to-disable-editable-table-columns-on-a-row-basis-in-javafx8 – purring pigeon Jul 01 '16 at 21:47
  • 1
    It's really impossible to answer this question without knowing some details of the circumstances under which the cells should be disabled. The general answer is simply the obvious one: create and `ObservableValue` representing when each cell should be disabled, and bind the cell's `disableProperty` to it. – James_D Jul 01 '16 at 21:53

1 Answers1

0

I found a good walkthrough for this. http://code.makery.ch/blog/javafx-8-tableview-cell-renderer

MattHampel
  • 29
  • 6