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:
var viewModel = kendo.observable({
aa: 1
, nestedStuff: {
bb: 2
, SetThisValue: function (newValue)
{
this.set('bb', newValue);
}
}
, OnShow: function ()
{
this.set('aa', 32);
this.nestedStuff.SetThisValue(123);
}
});
Which works as expected.
When I try to use a base class I use something like this:
var baseTestVM = kendo.data.ObservableObject.extend({
nestedStuff: {
bb: 2
, SetThisValue: function (newValue)
{
this.set('bb', newValue);
}
}
});
var viewModel = new baseTestVM({
aa: 1
, OnShow: function ()
{
this.set('aa', 32);
this.nestedStuff.SetThisValue(123);
}
});
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?