kendo mvvm - Uncaught TypeError: d.isSelectedHaertefallTyp is not a function(…)

172 views Asked by At

We are using kendo ui mvvm and we are having problems by binding methods to our view. we have the following viewModel:

    return kendo.observable({
        isSelectedHaertefallTyp: function () {
            return "test";
        },
        unternehmensbegrenzung: null,
        abnahmestellenbegrenzung: null,
        minDurchschnitt: null,
        maxDurchschnitt: null,
        bescheidbegrenzung: null,
        sollzahlung: null,
        bereitsGezahlt: null
    });

All properties are bounded correctly, but the method isSelectedHaertefallTyp does not get bounded and I get the following error:

Uncaught TypeError: d.isSelectedHaertefallTyp is not a function(…)

Here is how we binf this method in our view:

I'm afraid the view is trying to evaluate the method too early and at this point the bind has still not ocurred?

Any suggestion how to solve this?

EDIT:

I could "heck" the solution by creating the same method name in the parent ViewModel.

Thing is that I have a parent view and children with their own bindings. This works fine for properties, but not for method, so that is how thi works:

    base.prototype.bind.call(this); // parent binding

    this.generalInformationWizardStepComponent.bind(); // child binding
    this.additionalInformationWizardStepComponent.bind(); // child binding
    this.abnahmestelleWizardStepComponent.bind(); // child binding
    this.belieferungWizardStepComponent.bind(); // child binding
    this.summaryStepComponent.bind(); // child binding

And here is how I "hecked" the solution in the parent ViewModel:

return kendo.observable({
            isHaertefallTypSelected: function (value) {
                /* Markup Method Only 
                   The method is been bounded to early trying to get it from parent ViewModel and not considering the children
                */
            },
            showAdditionalInformation: true,
            currentStep: 0
        });

EDIT:

I found the issue, even tho I could not fix it. The problem is the parent has the children and bind them as well, so this should be the fix: http://www.telerik.com/forums/nested-views-bindings

0

There are 0 answers