Currently, a bound attribute on an HTML element cannot reference the reactive properties of the element itself. If, for instance, I want a checkbox to always be enabled if it's already checked, it seems that I have to take the following, slightly complicated approach:
isChecked = rx.cell()
R.input {
type: 'checkbox'
change: -> isChecked.set($(@).is(':checked'))
disabled: bind -> not isChecked.get() and someOtherCell.get()
}
It would be nice to be able to do something like:
R.input {
type: 'checkbox'
disabled: eBind ($elem) -> not $elem.rx('checked').get() and someOtherCell.get()
}
It would be even nicer if, instead of adding an argument to bind, we could do something like:
R.input {
type: 'checkbox'
disabled: bind => not @.rx('checked').get() and someOtherCell.get()
}
However, I'm not sure this last is feasible.