0

I'm building a simple mobile application and I want to bind html select elements to an observable kendo object. With simple input text straightforward but with select elements am receiving a error when changing select values:

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

Here is the jsfiddle example:

JS Fiddle example

Additionally on insert button, the object is not changing the property values present on the select elements.

crisleiria
  • 51
  • 1
  • 7

1 Answers1

1

The problem with the selects is that you have defined a function and it needs to be an object. Try defining them as:

zonas       : [
    { ZonaId : 1, nome : "zona1" },
    { ZonaId : 2, nome : "zona2" }
],
estados     : [
    { estadoId : 1, nome : "activo" },
    { estadoId : 2, nome : "inactivo" }
],
utilizadores: [
    { UtilizadorId : 1, nome : "user1" },
    { UtilizadorId : 2, nome : "user2" }
]

Regarding the insert button, the problem is that inserirEntidade is not being invoked since it is not visible/accessible when you click.

You have to define this function as global.

Check it here:

OnaBai
  • 40,767
  • 6
  • 96
  • 125
  • thanks it works! because my values are from localstorage i had a function. But I will create a array first and pass it to the observable object. – crisleiria May 10 '13 at 11:17