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

Change DataSource configuration at runtime

0 Answers 113 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Darryl
Top achievements
Rank 1
Darryl asked on 13 Nov 2012, 06:37 AM
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?

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Darryl
Top achievements
Rank 1
Share this question
or