How to Change Tracking and Commitable Data-Binding using KnockoutJS

Two-way data binding is a great feature as long as you are fine with direct updates to your new model. But, if you want a more advanced step where UI changes can be cancelled, two-way data-binding gets in the way. There is a great solution for it using Protected Observable plugin created by Ryan Nemiyer.

 

  1. First we update KnockoutJS using Nuget
  2. Once e have the latest JQuery and Knockout update, grab the plugin using JSFiddle then save it in a new JavaScript file.
  3. Now that you have the observable code, modify the application so that you have two states, View and Edit. In the View state, you’ll see the blog item as non-editable, Edit view on the other hand will present an editable page.

 

Read the rest of the tutorial here: http://www.dotnetcurry.com/ShowArticle.aspx?ID=876

Leave a Reply

Your email address will not be published. Required fields are marked *