I wasn't sure if this belonged in the datasource or mvvm thread. We're attempting to use MVVM with a remote data source, however, we have several cases where we want to add more objects to the data source from the local side.
In our case, one example is for a select list with 1000 items in it. We can have our web service build that select list object, but it increases the request size considerably. We would prefer that this list of 1000 items be generated using a for loop on the client side. We've tried things like this:
I'm filling the data object in the change event of the datasource.
However, when I bind a select list to the UserLimitOptions object of the view model, the change event of the select list errors - I assume because UserLimitOptions isn't "observable".
Any ideas on this?
In our case, one example is for a select list with 1000 items in it. We can have our web service build that select list object, but it increases the request size considerably. We would prefer that this list of 1000 items be generated using a for loop on the client side. We've tried things like this:
var
UserLimitOptions =
function
() {
var
options = [];
for
(i = 1; i <= 1000; i++) {
options.push({ Id: i, Name: i });
}
return
options;
};
var
subscriptionViewModel =
new
kendo.data.ObservableObject({
data: [],
UserLimitOptions: UserLimitOptions
});
I'm filling the data object in the change event of the datasource.
However, when I bind a select list to the UserLimitOptions object of the view model, the change event of the select list errors - I assume because UserLimitOptions isn't "observable".
Any ideas on this?