Change DataSource configuration at runtime

1 posts, 0 answers
  1. Darryl
    Darryl avatar
    23 posts
    Member since:
    May 2005

    Posted 13 Nov 2012 Link to this post

    I have a datasource that services an autocomplete control. Works great with just the basic service url defined for the read operation.

    I would like to use the same datasource for other more complex queries for other controls on the page. For example, I'd like to add the $expand option to include associations but I don't want to add this complexity by default to slow down the autocomplete.

    Can I modify the configuration of the datasource at runtime to service a number of controls with different needs or should I define separate datasources for each control?

    For example how do I add / remove the expand property at runtime? ...

    transport: {
        read: {
            url: "MyService.svc/Categories",
            data: {
                expand: "Products"

    Can this be done with a filter?
Back to Top