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

Uncaught TypeError: Object #<Object> has no method 'get'

1 Answer 72 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
jon
Top achievements
Rank 1
jon asked on 25 Aug 2013, 11:27 PM
I'm binding a select like this in a listview template.

<select class="status" class="select" data-value-field="StatusName" data-text-field="Description" data-bind="events: {change: statusChangeEvent}, source: options, value: status" />

everything works fine, the selection options are bound, except when I change the selection I get an error that the object has no method 'get'.

what am I doing wrong?

thanks.

Jon
     

1 Answer, 1 is accepted

Sort by
0
jon
Top achievements
Rank 1
answered on 26 Aug 2013, 04:59 PM
Ok, so here is the solution:  the array that is bound to the select must be an observable but you can't just do this:

 var options = kendo.observable([{},{},{}]);

What you have to do is this:

var options = kendo.observable({ items: [{},{},{}] });

Then, change the select data-bind:

data-bind="source: options.items"
Tags
MVVM
Asked by
jon
Top achievements
Rank 1
Answers by
jon
Top achievements
Rank 1
Share this question
or