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

Share DataSource - identify who is requesting data

1 Answer 29 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Wolfgang Kamir
Top achievements
Rank 1
Wolfgang Kamir asked on 01 Oct 2012, 06:17 AM
Hi dear forum members and support team!

Is it a customary scenario to share a datasource between multiple widgets?

In my scenario it is possible to enter several different Addresses - which all have a Country and Province to be selected (depending on each other)

I was trying to setup just one _countryDataSource and one _provinceDataSource.

I have two issues now...

1) Once any Country-Combobox (kendo-combobox) has a changed selection, I want to "refresh()" the according Province-Combobox. (How would I go about that?)

2) How could I now identiy, which Province-Combobox made the request to the shared DataSource?


I am pretty sure that it would be easier to just "not share" the DataSources but build up one for each ComboBox.... would this be a better approach? Or is there an easy way to achieve my requirements?

Also: How resource intensive is it to build up a DataSource?... because if it is leightweight and not really strains the resources it would not make sense to share DataSources at all....

Please note that the Cascading-Combo-Boxes samples do not really apply to my scenario.... I need a little more control, since it should also be possible to enter a custom country (which is not - yet - in the list) or a custom province.


Thanks you very much for any help!

Kind regards,
Wolfgang

1 Answer, 1 is accepted

Sort by
0
Wolfgang Kamir
Top achievements
Rank 1
answered on 05 Oct 2012, 09:10 AM
... nevermind.

It seems best to just have a dedicated dataSource for every widget. Works fine.

Also to refresh a combobox from the assigned datasource (which sends an ajax request in my case) I just had to call _comboBoxWidget.dataSource.read().

The very nice thing about that is that I could even hand over parameters to the 'read()' method of the datasource.

Kind regards,
Wolfgang
Tags
Data Source
Asked by
Wolfgang Kamir
Top achievements
Rank 1
Answers by
Wolfgang Kamir
Top achievements
Rank 1
Share this question
or