unbind

Unbinds a tree of HTML elements from a View-Model.

Example

 <div id="view">
   <label>First Name:<input data-bind="value: firstName" /></label>
   <label>Last Name:<input data-bind="value: lastName" /></label>
   <button data-bind="click: displayGreeting">Display Greeting</button>
 </div>
 <script>
 var viewModel = kendo.observable({
    firstName: "John",
    lastName: "Doe",
    displayGreeting: function() {
        // Get the current values of "firstName" and "lastName"
        var firstName = this.get("firstName");
        var lastName = this.get("lastName");
        alert("Hello, " + firstName + " " + lastName + "!!!");
    }
 });
 kendo.bind($("#view"), viewModel);
 // unbind the view model
 kendo.unbind($("#view"));
 </script>

Parameters

element String|jQuery|Element

The root element(s) from which the unbinding starts. Can be a valid jQuery string selector, a DOM element or a jQuery object. All descendant elements are traversed.

In this article
Not finding the help you need? Improve this article