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

DropDownList and MVVM loads double

2 Answers 64 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Jaap
Top achievements
Rank 2
Jaap asked on 26 Mar 2012, 09:14 AM
I have a dropdownlist with the data-bind attribute set to {value: myfield} and data-source attribute set to {"transport":{"read":"myurl"}} (and the data-role of course).
It is loading the datasource 2 times (2 requests to the server). I think that the first time the data is read on creation of the DataSource and the second time when the value is binded. But I am not sure about that. I saw that the second time does not occur when myfield is empty.
Hope you can reproduce this with this info, if not I will take some time to create simple repro.

Regards, Jaap

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 26 Mar 2012, 02:08 PM
Hi Jaap,

The second request in the described scenario is caused by the fact that when setting the value and the DropDownList is not yet populated, it will issue a query through the DataSource to populate itself. The DropDownList is not populate at this point as the response from the first request is not yet received. Usually this behavior is prevented by setting autoBind option of the DropDownList to false. Unfortunately, in the current version of MVVM this option will not take effect when widget is created declarative and the DataSource is a MVVM property. This we have already addressed, and the fix will be available in the internal builds and also with the next service pack.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jaap
Top achievements
Rank 2
answered on 26 Mar 2012, 02:11 PM
Ok, thank you.
Jaap
Tags
MVVM
Asked by
Jaap
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Jaap
Top achievements
Rank 2
Share this question
or