I am looking to divide my DevExtreme Scheduler into two separate view models. One will be responsible for displaying the Scheduler itself, while the other will handle the Popup and button functionality. Despite having everything set up, I am struggling to call a function within the Popup view model.
$(document).ready(function () {
var schedulerModel = new viewModel();
ko.applyBindings(schedulerModel, document.getElementById("BookingScheduler"));
var popupModel = new viewPopup();
ko.applyBindings(popupModel, document.getElementById("BookingPopup"));
});
Within my Scheduler, I have a click handler where I need to call the loadData
function from the popup view model.
function viewPopup() {
function loadData(data) {
}
}
I attempted calling it using popup.loadData(data);
and viewPopup().loadData(data);
, but neither worked. I received an error stating popup.loadData() is not a function. How can I successfully achieve this?