
Scott Rakestraw
Top achievements
Rank 1
Scott Rakestraw
asked on 03 May 2013, 06:06 PM
I have a dropdownlist which is bound to a shared kendo datasource. The shared datasource has already read it's data in. When I am binding it to this drop down it is calling read on this dataset again. If I create ddl without the data-bind it will not attempt to read the data a 2nd time. How do I prevent the dropdownlist from forcing the datasource to read the data?
var ddl = $('<
input
data-bind
=
"value:' + options.field + '"
style
=
"display:none;"
/>')
.appendTo(container);
ddl.kendoDropDownList({
dataTextField: list.displayColumn,
dataValueField: list.valueColumn,
autoBind: false,
optionLabel: optionLabel,
dataSource: list.dataSource
});
5 Answers, 1 is accepted
0

Charles Benoualid
Top achievements
Rank 1
answered on 06 May 2013, 06:46 PM
I have the same problem, did you find a solution?
0
Hi guys,
To avoid the additional read request, please set the autoBind option of the widget to false.
Kind regards,
Alexander Valchev
the Telerik team
To avoid the additional read request, please set the autoBind option of the widget to false.
data-auto-bind="false"
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Scott Rakestraw
Top achievements
Rank 1
answered on 07 May 2013, 01:08 PM
I have changed the code
The same problem still exists. It is forcing a second call to get the data. When creating the drop down I had already specified autoBind false there. It is now set in both places.
var ddl = $('<
input
data-bind
=
"value:' + options.field + '"
style
=
"display:none;"
data-auto-bind
=
"false"
/>').appendTo(container);
0
Hi Scott,
I prepared a small sample to test the solution - I checked the network tab and did not manage to observe any additional requests. Could you please check it and let me know what I am missing?
Kind regards,
Alexander Valchev
the Telerik team
I prepared a small sample to test the solution - I checked the network tab and did not manage to observe any additional requests. Could you please check it and let me know what I am missing?
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Scott Rakestraw
Top achievements
Rank 1
answered on 09 May 2013, 07:08 PM
I found my problem. I was doing a basic pub/sub so that the list could build itself after the data was returned in the schema data function. I needed to change that publish event to run inside a setTimeout so it would run after the datasource was filled.