Category Archives: Knockout.js

Knockout.js: Pagination with ASP.NET Web API (or WCF service)

Introduction
In this article, I am trying to implement HTML table as a grid with pagination using knockout.js. This is the easiest way to get page wise data from server using ASP.NET Web API (or WCF service) and display them as a grid.

Before we jump in to this article, let’s have a look at the standard definition of Knockout.js and ASP.NET Web API:

Knockout.js is a JavaScript library that helps you to create rich, responsive displays and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically (e.g., changing depending on user’s actions or when an external data source changes), KO can help you implement it more simply and maintainable.

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

Read the rest of this entry

Advertisements

Knockout.js: Built in Bindings

Introduction:
The Built in bindings are built into knockout.js and facilitate binding to attribute for elements. We can use multiple bindings separated by commas.

The built in bindings are categorized as:

1. Bindings to control text and appearance

  • text
  • html
  • visible
  • css
  • style
  • attr

Read the rest of this entry

Knockout.js and Model-View-View Model (MVVM) Pattern

Introduction:
Knockout.js is a javascript library that helps us to create rich and responsive use interfaces with a clean data model.

Features:
1. Declarative Bindings – A simple way to bind a part of UI to data model.
2. Dependency Tracking – Automatically updates right part of UI when data model changes.
3. Templating – A simple way to make nested UIs as a function of view model data.
4. Trivially Extensible – With a just few line of code, we can implement custom behaviors as new declarative binding for easy reuse.

Read the rest of this entry

%d bloggers like this: