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

Single DataSource making multiple Server Requests

3 Answers 608 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 12 Jan 2017, 01:05 PM

Hi, 

I have 4 Drop Down Lists (spread over 4 tab panels) all using the same 'Locations' dataSource. The problem is when each drop down is initialized, a server request is made to retrieve its data. Which is weird, because shouldnt the DS make a server request the first time, and use the same response for the rest?

Unless the 'read()' call hasnt completed by the time the others initialize and so they each make their own call as well?

Please advise.

Thanks,
Grant

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 13 Jan 2017, 04:34 PM
Hi Grant,

The observed behaviour is expected unless the Kendo UI DropDownLists have their autoBind  property set to false (it is true by default):

http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-autoBind

So in your case, you may set autoBind: false to three out of the four Kendo UI DropDownLists and that will result in a single request which will and populate all four lists.

For your convenience, I have prepared a sample demo at:

http://dojo.telerik.com/ecONI

Have a nice weekend!

Kind Regards,
Alex Hajigeorgieva
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualisation (charts) and form elements.
0
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 16 Jan 2017, 09:50 AM

Thanks Alex, 

I didnt realize that the AutoBind HAD to be false for the DropDowns to read from a single DataSource.

My dropdowns are loading more efficiently now. My scenario has changed slightly, in that all the dropdowns now have autoBind: false, however the dropdowns are all still populating. What events would cause the DS to execute a read?

Im binding a function to the 'change' event and Im (of course) reading the value (dropdownlist.value());

Thanks and Kind Regards, 
Grant

0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 16 Jan 2017, 03:00 PM
Hello Grant,

I am pleased to hear that you found my response helpful.

The Kendo UI DropDownLists should not be populating unless the Kendo UI Data Source triggers its change event. The change event of the data source would be triggered if you open the Kendo UI DropDownList (mouse or keyboard) as well as the listed actions at:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-change

Are you able to replicate this behaviour in this updated Dojo and return the newly generated URL from the address bar so I can inspect it locally and get back to you in the most time-efficient

Kind Regards,
Alex Hajigeorgieva
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
General Discussions
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Alex Hajigeorgieva
Telerik team
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Share this question
or