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...
I am creating a guest list app using Knockout.js, and so far things are going swimmingly. However I have a best-practices question. My app has several different types of objects: guests and tags among them. Guests can have multiple tags, and tags can...
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'm trying to map JSON data using the knockout.mapping plugin, however the heirarcical JSON data fails to populate my object properties correctly, the top level loads fine but not the child 'RootTarget'  data?  What am I doing wrong?  Kno...
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...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.