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

Object doesn't support property or method 'observable'

4 Answers 155 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
oakcool
Top achievements
Rank 2
oakcool asked on 04 Apr 2012, 08:29 AM
Hi I am using the example for form binding and is not working at all, when I run it gives the message in the title.

$(document).ready(function () {
        var viewModel = kendo.observable({
            email: "someemail@somesite.com",
            password: "p@ssword",
            passwordConfirmation: "p@ssword",
            confirmed: false,
            register: function (e) {
                e.preventDefault();
 
                this.set("confirmed", true);
            },
            startOver: function () {
                this.set("confirmed", false);
                this.set("email", false);
                this.set("password", "Male");
                this.set("passwordConfirmation", "John");
            }
        });
 
        kendo.bind($("#example"), viewModel);
    });

The HTML is very similar to the one on the website as well.

<div id="example" class="k-content">
    <div id="loginForm">
                
        <div id="description">           
            <p>Some Text</p>
        </div>
         
        <div id="login">
            <h2>
                Want us to get in touch with you</h2>
            <br />
            <form>
                <label>
                    Email:
                    <input data-bind="value: email" /></label>
                <br />
                <br />
                <label>
                    Password:
                    <input data-bind="value: password" /></label>
                <br />
                <br />
                <label>
                    Confirmation:
                    <input data-bind="value: passwordConfirmation" /></label>
                <br />
                <br />
                <button data-bind="enabled: agreed, click: register">
                    Register</button>
                <br />
                <div data-bind="visible: confirmed">
                    <h4>
                        Confirmation</h4>
                    <div>
                        Thank you for your registration, <span data-bind="text: email"></span>                                                                                                 
                        <br />
                        <br />
                        <button data-bind="click: startOver">
                            Start Over</button>
                    </div>
                </div>
            </form>
        </div>
         
    </div>
</div>


Any ideas???

4 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 04 Apr 2012, 08:31 AM
Hello,

 You are probably using an older version of Kendo UI which does not support MVVM.

Kind regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
oakcool
Top achievements
Rank 2
answered on 04 Apr 2012, 08:33 AM
I got the one that available in Nuget, is that old?
0
Atanas Korchev
Telerik team
answered on 04 Apr 2012, 08:34 AM
Hello,

 Yes, it hasn't been updated yet.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
oakcool
Top achievements
Rank 2
answered on 04 Apr 2012, 08:38 AM
Ok now it worked thanks
Tags
MVVM
Asked by
oakcool
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
oakcool
Top achievements
Rank 2
Share this question
or