edvin
05/12/2017, 6:22 PMdoubleu
05/12/2017, 6:41 PMmasterUserProperty.stringBinding { it?.name ?: "" })
Am still gonna use a ViewModel, just for completeness' sake 🙂
(Essentially the same as my No. 3)edvin
05/12/2017, 6:44 PMedvin
05/12/2017, 9:49 PMcache
function, and how it drastically improves cellFormat
performance and reduces the memory overhead.edvin
05/12/2017, 9:50 PMgraphic
inside of cellFormat
, you should use this pattern:edvin
05/12/2017, 9:51 PMedvin
05/12/2017, 9:51 PMedvin
05/12/2017, 9:52 PMcache("someKey") { buildMyNodesHere() }
edvin
05/12/2017, 9:52 PMedvin
05/13/2017, 11:55 AMassignIfNull
as a middle way:edvin
05/13/2017, 11:55 AMassignIfNull
helper,
which will assign a value to any given property if the property doesn't already contain a value. This will make sure that
you avoid creating new nodes if updateItem
is called on a cell that already has a graphic property assigned.
kotlin
cellFormat {
graphicProperty().assignIfNull {
label("Hello")
}
}
nimakro
05/13/2017, 12:06 PMjchildress
05/13/2017, 12:45 PMjchildress
05/13/2017, 12:45 PMjchildress
05/13/2017, 12:45 PMedvin
05/13/2017, 1:48 PMcellFormat
it could help with keeping things clean. You could also just create a function and call cellFormat(myfn)
.carlw
05/13/2017, 2:35 PMcarlw
05/13/2017, 2:40 PMuser
05/13/2017, 2:43 PMcarlw
05/13/2017, 2:46 PMkastork
05/13/2017, 2:49 PMcarlw
05/13/2017, 2:51 PMedvin
05/13/2017, 2:58 PMcarlw
05/13/2017, 3:00 PMcarlw
05/13/2017, 3:00 PMkastork
05/13/2017, 3:21 PMnimakro
05/13/2017, 4:10 PMnimakro
05/13/2017, 4:10 PMedvin
05/13/2017, 4:10 PMkastork
05/13/2017, 4:10 PM