This is a migrated thread and some comments may be shown as answers.

Calling Viewmodel Method from HTML markup?

1 Answer 122 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 07 Jun 2013, 03:38 PM
Is it possible to call a viewmodel method from within the markup for a viewmodel?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 11 Jun 2013, 09:11 AM
Hello Michael,

I am not sure what exactly you would like to achieve. In general it is possible to execute a ViewModel method when a certain event occurs - for example when an HTML button is clicked. For example:
Another possible option is to bind a field to a MVVM method which calculates and returns its value. For more information please check the corresponding docs.
In both cases the ViewModel method is called via data-bind attribute.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
Michael
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or