title: Knockoutjs get parent object
body: <p>I am having difficulties on getting the parent object's certain field from child object using knockout.js.<br></p>
  
  <pre><code>function Child(info){
      var self = this;
      self.x = info.x;
      self.y = info.y;
      self.parentThing = parent.fieldToGet();  // This is when I had problem
  }
  
  function Main() {
      var self = this;
      self.fieldToGet = ko.observable();
              self.things = ko.observableArray();
      self.postFunction = function(){
          $.post('XXX.php', $("form#filterForm").serialize(), function(data){
                  var mappedThing = $.map(data.data, function(info){return new Child(info); });
                  self.things(mappedThing);
              }
          }, 'json');
      };
  }
  var main = new Main();
  ko.applyBindings(main, $("div#main")[0]);
  </code></pre>
  
  <p><br><br>
  The hierachy is Main has several Child. In Child object I want to get its parents 'attribute': fieldToGet.</p>