aayush
09/21/2017, 1:26 PM.custom-tree-table-header .tree-table-row-cell{
-fx-background-color: rgba(199, 204, 228, 0.3);
-fx-text-fill: black;
-fx-border-color: #b9bacc;
-fx-table-cell-border-color:#b9bacc;
-fx-border-width: 0.2px;
}
.custom-tree-table-header .tree-table-cell{
-fx-background-color: rgba(255, 255, 255, 0.0);
}
But I want a different color of the child rows.
var persons = mutableListOf<Voucher>().observable()
for (i in 1..5)
persons.add(
Voucher("3-4-2017", "HDFC BANK", "Receipt", "1", "3200", "42424", listOf(
Voucher("", "JOHN DOE", "Receipt", "1322", "1600", "21212"),
Voucher("", "JOHN DOE", "Receipt", "1466", "1600", "21212"),
Voucher("", "JOHN DOE", "Receipt", "1466", "1600", "21212"))))
class Voucher(val date: String,
val particulars: String,
val voucherType: String,
val voucherNo: String,
val debit: String,
val credit: String,
val voucherList: List<Voucher> = emptyList())
treetableview<Voucher> {
style {
backgroundColor += Styles.textFieldbackground
}
addClass("custom-tree-table-header")
column("DATE", Voucher::date)
column("PARTICULARS", Voucher::particulars)
column("VOUCHER TYPE", Voucher::voucherType)
column("VOUCHER NO.", Voucher::voucherNo)
column("DEBIT", Voucher::debit)
column("CREDIT", Voucher::credit)
isShowRoot = false
root = TreeItem(Voucher("", "",
"", "", "", "", persons))
populate { it.value.voucherList }
root.isExpanded = true
columnResizePolicy = TreeTableView.CONSTRAINED_RESIZE_POLICY
}
This is my implementation.
Here is what I have got so far.
https://cl.ly/2p0a1D2D0o3C
I want to change the style of rows which have "JOHN DOE"
And is there any way to handle root in TreeTableView. I've hidden the root in my view as I don't want a single root.