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

Widgets not initializing when using source binding and template

1 Answer 66 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Trent
Top achievements
Rank 2
Trent asked on 20 May 2014, 11:29 PM
I'm trying to use source binding to an observable array to enable the user to dynamically add new elements as required. My item template has a few hidden fields and a kendo ui editor. The editor is initialized with jQuery in the template. The problem, however, is that the editor is not being initialized properly after the view model has been bound.

I have created a jsBin showing the problem: jsBin

Notice that that editors for the initially-bound items are correctly initialized, but any added elements are not. If I unbind and re-bind the entire view model after each item is added then everything will work, but that seems like serious overkill. Any feedback would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 22 May 2014, 01:31 PM
Hello Trent,

You need to initialize the widget using attribute initialization, so the editor is correctly displayed, please check the updated example here:

http://jsbin.com/daxezefi/5/edit

Regards,
Kiril Nikolov
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
Trent
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Share this question
or