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

MVVM biding for KendoSlider

1 Answer 35 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Dr.YSG
Top achievements
Rank 2
Dr.YSG asked on 03 May 2013, 05:32 PM
I have a kendoObservable (numeric value) that is bound both to a span (text: ) and a kendo slider (value:)

I have a button that increments the value. But only the text version is updating. What did I do wrong?

An example is worth a thousand words:

http://jsbin.com/afogaq/2/

One wrinkle here is that i need to dynamically add the slider. So there is a button at the top that you have to hit first, to add the slider to the DOM. Then just press the [increment] button to see what is going on.

(do I have to rebind the VM, after adding the slider?).

1 Answer, 1 is accepted

Sort by
0
Accepted
Holger
Top achievements
Rank 1
answered on 05 May 2013, 02:20 PM
Yes, you will have to re-bind the viewmodel. A repetitive call to Kendo.bind will first unbind and then bind the specified DOM elements.

Please check your modified sample here: http://jsbin.com/agazaz/1/
Tags
MVVM
Asked by
Dr.YSG
Top achievements
Rank 2
Answers by
Holger
Top achievements
Rank 1
Share this question
or