So with the upper statements this should work:
but it doesn't.
Is there any way to inherit with MVVM? In my SPA I could share some MVVM and I don't want to duplicate code.
5 Answers, 1 is accepted
extend is a class method and the kendo.observable method creates an instance so extend will not be available. You should extend kendo.data.ObservableObject instead in order to create a base class for the ViewModels e.g.
I've tried this but I have some issues with the functions available in the base class when there are nested structures.
In the flat (all in one class) version I have something like:
Which works as expected.
When I try to use a base class I use something like this:
Which gives an error on the line with this.set('bb', newValue); giving the error that this.get is not a function script.
When you use the this.set() function outside the nested stuff, the this.set works.
Can you help me with this?
Here's an example how this scenario can be implemented: dojo.
Ah, I see what you mean.