I am using Knockout.js as a MVVM library to bind my data to some pages. I'm currently building a library to make REST calls to a web service. My RESTful web service returns a simple structure:  {     id : 1,     details: {         name: "John...
Say I have this array of same-type objects:  var people = [     { status: 0, name: "name1"},     { status: 1, name: "name2"} ];   and I want it not only to be observableArray, but also I want to observe ONLY, say, status property of e...
I have an observable array  var myArray = ko.observableArray([       { name: "Jimmy", type: "Friend", Age: 30 },       { name: "George", type: "Friend", Age: 40 },       { name: "Zippy", type: "Enemy",...
I am having issues with defining a function inside my viewmodel.  I fetch json data via jquery getJSON and map this data to my viewmodel.  $.getJSON('/Company/GetCompanies', function(data) {      var viewModel = new CompanyViewModel()     vie...
Using Knockout.JS, I'm trying to determine how to best extend objects in the view model when they will be both loaded via the mapping plugin and dynamically added. In this example, I'm adding a method addChild to the Person object.  Extending...
I am new to knockout and I am having a problem with using the mapping plugin as I do not understand how it maps my JSON data.  This is a sample json data similar to what is in my program:  contact: {         name : 'John',         email : ...
Does anyone have idea, if it's possible to detect whenever a change occur inside observableArray while using ko mapping, this mean without having to create the model by hand?  self.items = ko.observableArray([]) var data = ko.mapping.fromJS(resul...
I am trying to use knockout-sortable, with the mapping plugin, to drag a list of products to another list.   Here is a very stripped-back fiddle to try and show what I'm getting at.  What I want is for the products in the 'cart' to refere...
See JsFiddle here http://jsfiddle.net/WtgbV/2/  In words: I have some ajax call, and in the server's response I get some array of items (Items in knockout viewmodel)  I need to know that property name was changed in element with id==2 etc to save...
Here's my scenario.  I'm using the knockout mapping plugin to create an observable viewmodel hierarchy for me.  My hierarchy has nested elements in it.  At a particular point in the hierarchy I want to put an Add button to insert a new blank...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.