Lets say i have this:
<div data-bind="enable: false">
<div data-bind="someCustomBinding: myValue"></div>
</div>
Is is possible for me to access the 'enable' binding of the parent container from within the custom binding?
== Clarification: ==
In a custom binding you can gain access to the current binding value with the valueAssessor. you can also gain access to other bindings through allBindings and even values on different related contexts via the bindingContext.
I was just wondering if you could access the binding of a parent html element from within a custom binding (in a similar way to the valueAccessor)
Something like this (sudo code):
ko.bindingHandlers.someCustomBinding=
{
init: (element, valueAccessor, allBindings) =>
{
var parentIsEnabled =
ko.GetContextFor($(element).parent()).get('enable');
}
}