Javascript inheritance in Knockout ViewModels

Knockout is an elegant way of updating the user interface using Javascript View models. Javascript has an inheritance model which allows for a View model hierarchy. As an illustration, consider the following HTML:

The name and detail properties of the View model are bound to the respective div elements. The Javascript which applies the binding is shown below:

[…]

Read more

Performance problems using Knockout observableArray

I am a fan of Knockout. I recommend using Knockout over jQuery for any non-trivial UI. In Knockout, observable() and observableArray() are two basic objects. observable() enables two-way binding between the UI and the javascript View Model. observableArray() provides array functionality to an observable(). observableArray() can be used to store a collection of View Models. The natural way to add[…]

Read more

The drawback of Knockout.js

Knockout.js is a declarative way to bind Javascript View Models to HTML views. It is definitely a very good framework for building single page applications. But, it has a few drawbacks. But before going over the drawbacks, I will briefly highlight the problem that it solves in ASP.NET MVC. Central to the ASP.NET MVC theme is the Model class. The[…]

Read more

Introduction to Knockout.js and ASP.NET MVC

Knockout.js is a javascript framework for creating MVVM like browser apps. MVVM stands for Model-View-ViewModel. Model represents the data. View represents the UI. ViewModel represents how the model is represented within the View. ViewModel also encapsulates the behaviour of the view. For eg, the rule: for some conditions in the data (model), set a green background to the table cell,[…]

Read more