Is your UI suited for MVVM ?In my opinion, UIs with repeating sections , with supportfor inline addition and deletion are best suited for MVVM. A grid with inline add/delete functionality is a good example of this. Many a times, each row of the grid is collection of controls or a sub-grid itself. The form-post model will work in such scenarios, but it is very painful to manipulate DOM when user clicks on Add or Delete. In such scenarios, using knockout.js or MVVM is recommended in my opinion. The ‘automatic UI refresh’ is another great feature of knockout.js which can save you from writing (and testing!) lengthy javscript code.
What about the ‘learning curve’ ?There is a slight learning curve when using knockout.js. A bigger problem is ‘getting stuck while doing something which is not readily supported’. When we encounter such a problem, it is extremely important to handle it in a proper way. Using ‘hacks’ to deal with such scenarios can cause un-expected behaviour when running inside untested enviornment (different browser, different version of *.js). In short, try to create more than one POC , before you take decision to use knockout.js on a large scale.
Copyright (c) 2007-2019 Ashish Patil . Please read FAQ for more details.