Share DataSource - identify who is requesting data

2 posts, 0 answers
  1. Wolfgang Kamir
    Wolfgang Kamir avatar
    80 posts
    Member since:
    Jul 2006

    Posted 01 Oct 2012 Link to this post

    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
  2. Wolfgang Kamir
    Wolfgang Kamir avatar
    80 posts
    Member since:
    Jul 2006

    Posted 05 Oct 2012 Link to this post

    ... 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
  3. Kendo UI is VS 2017 Ready
Back to Top