I am trying to disable a certain option of select generated from knockout on the checkout page. I tried what was mentioned on the knockout documentation i.e. to call optionsAfterRender
. But this gives error and I think magento provides AfterRender for this, but the function example provided on the official documentation does not work.
the following code does not work to my expectations i.e. to disable certain option.
setOptionsDisable: function (option, item) {
ko.applyBindingsToNode(option, {disable: item.disable}, item);
},
Although I have also added disable: ko.observable(true)
to the observable array as key|value.
So, how do I disable the option once it's been rendered? I don't think it can be disabled while rendering.