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

MVVM Binding, Kendo UI Mobile and Dropdownlist

3 Answers 298 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Oct 2013, 05:48 AM
Hi There,

I'm trying to get a dropdown list used with Kendo UI mobile and data bind the source of the dropdown list to some set data.

It seems to work when a plain select is used but when i change the data-role to dropdown list the list is always empty. 

I have include a sample of the problem i am experiencing.

http://jsbin.com/ADOTuG/1/

Is there something I am doing wrong here or should do differently?

Thanks,

Rob

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 09 Oct 2013, 07:27 AM
Hi Robert,

the recommended way to use MVVM with Kendo UI Mobile would be through the data-model attribute. Please check this updated version of your sample.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robert
Top achievements
Rank 1
answered on 10 Oct 2013, 05:12 AM
Hi Petyo,

I have a number of problems using the data-model configuration because I need to bind data dynamically rather than using the same observable always. I also need to specify data binding at a more specific level that just whole mobile view.

How would I perform data binding of two different models to two div tags in the same view in a mobile environment?

I currently bind the views using the kendo.bind command (It satisfies all of my requirements) and it works as expected on each div, I am just unable to get data binding of the drop down list working.

Thanks,

Rob
0
Petyo
Telerik team
answered on 14 Oct 2013, 07:06 AM
Hello Robert,

you may consider using a single viewmodel and assigning the two models in question to its fields.

The reason why we recommend using data-model instead of kendo.bind is performance. The mobile views do declarative initialization of the widgets (based on the data-role attribute), and kendo.bind does the same + establishing the bindings. The data-model field performs this in a single pass, thus avoiding the costly DOM recursive traversing. 

In case you insist on using the kendo.bind approach, you will have to pass multiple namespaces as arguments, as documented and showcased in our API reference

Regards,
Petyo
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
Robert
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Robert
Top achievements
Rank 1
Share this question
or