This is a migrated thread and some comments may be shown as answers.
viewModel inheritance from a baseViewModel?
2 Answers 21 Views
This is a migrated thread and some comments may be shown as answers.
Darryl
Top achievements
Rank 1
Darryl asked on 21 May 2013, 01:48 AM
I have a bunch of pages that share a navigation template and common viewModel navigation properties that can be bound to a particular entity ID being passed between pages.

Doesn't really matter if I haven't explained that too well but bottom line is the properties are pretty much identical for each viewModel apart from an ID tagged on the end of a URL string

Along the lines of this post regarding Knockout ...

http://stackoverflow.com/questions/16569810/knockout-viewmodel-base-class-javascript-inheritance

is it possible to in the Kendo framework to implement a baseViewModel that other viewModels can inherit from?



2 Answers, 1 is accepted

Sort by
0
Darryl
Top achievements
Rank 1
answered on 21 May 2013, 06:43 AM
Here's an example using Knockout showing what I'd like to do using Kendo ...

http://jsfiddle.net/stratdaz/Ht8GR/6/
0
Accepted
Darryl
Top achievements
Rank 1
answered on 22 May 2013, 05:32 AM
Alexander from Telerik has kindly answered my question with this ...

Hi Darryl,

In Kendo MVVM you can achieve inheritance through the extend method. I prepared a small example to demonstrate the approach. Please check it and let me know if you have any further questions:
http://jsbin.com/imuyuh/2/edit
Kind regards,
Alexander Valchev
the Telerik team

Tags
MVVM
Asked by
Darryl
Top achievements
Rank 1
Answers by
Darryl
Top achievements
Rank 1
Share this question
or