I have an object inside the viewModel where the "visible" property will have the value of the loadingVisible variable declared inside the viewModel as an observable.
My problem is that I always get the following error: Cannot read properties of undefined (reading 'loadingVisible');
I've tried in several ways but I still have the same error, is there any solution?
var viewModel = {
loadingVisible: ko.observable(false),
loadOptions: {
visible: viewModel.loadingVisible(),
showIndicator: true,
showPane: true,
shading: true,
hideOnOutsideClick: false,
shadingColor: 'rgba(0,0,0,0.4)',
},
};
return viewModel;
HTML
<div class="loadpanel" data-bind="dxLoadPanel: loadOptions"></div>