Q:

Disable select list with knockout

I'm trying to disable a select list using knockout disable binding. It doesn't work. The list is still enabled when the value (readOnly.IsNew) is true. I've checked that the value is correct i.e. readOnly.IsNew. It works fine for a checkbox, just not the select list.
<select name="myDropDown" data-bind="
                    options: $parents[1].readOnly.myList,
                    value: selectedMethod,
                    disable: !(readOnly.isNew)"></select>

A:

I guess that isNew is observable, in that case you need to unwarp it when it is used in expressions:
disable: !(readOnly.isNew())

If you put just observable to data-bind knockout automatically unwrap it, for example you could write and it would work:
disable: readOnly.isNew

However when you use expression in data-bind knockout cannot unwrap observable and you should do it by yourself. For example if you want to hide select when there are no records you should write the following:
visible : $parents[1].readOnly.myList().length > 0

