title: ObservableArray not reflecting data update
body: <p>I'm creating an app using the very slick KnockoutJS library, but I've run into a snag. On the html page, I have a plain <code>&lt;select&gt;</code> control that I want to load with JSON data returned from a web service. </p>
  
  <p>I define the observable array as follows:</p>
  
  <pre><code>var laborRow = function () {
      this.positions = ko.observableArray([]);
  };
  </code></pre>
  
  <p>When the page loads, the ajax call is made and the data is returned. In the callback, I do the following:</p>
  
  <pre><code>    success: function (msg) {
          laborRow.positions = msg;
      }
  </code></pre>
  
  <p>based on the KO docs, I would expect that I would set the result like this:</p>
  
  <pre><code>laborRow.positions(msg);
  </code></pre>
  
  <p>However, that just throws an error stating that "laborRow.positions in not a function"</p>
  
  <p>The template in the html is as follows:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;tbody data-bind='template: {name: "laborRowTemplate", foreach: laborLine}'&gt; &lt;/tbody&gt; 
  &lt;/div&gt;
    &lt;script type="text/html" id="laborRowTemplate"&gt; 
          &lt;tr&gt;
  
            &lt;td&gt;&lt;select data-bind='options: positions, optionsText: "Title", optionsCaption: "select", value: selectedPosition '&gt;&lt;/select&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
      &lt;/script&gt;
  </code></pre>
  
  <p>The <code>laborRow</code> object is a property on the ViewModel which is bound to the page. For whatever reason, this does not work. To add another wrinkle, if I add code to peek into the observableArray and print out some piece of data, the data is in there. So it is being loaded successfully.</p>
  
  <p>Any thoughts would be greatly appreciated.</p>
  
  <p>The full code for my example case:</p>
  
  <pre><code>var laborRow = function () {
      this.positions = ko.observableArray([]);    
  };
  
  var projectEstimate = function () {
      this.laborLine = ko.observableArray([new laborRow()]);
  
  };
  
  var projectViewModel = new projectEstimate();
  ko.applyBindings(projectViewModel);
  
  //and the code in the callback function on ajax success
  
   success: function (msg) {
                  laborRow.positions = msg;
                  //laborRow.positions(msg); **this does not work - error is laborRow.positions is not a function**
              },
  </code></pre>
  
  <p>And the html:</p>
  
  <pre class="lang-html prettyprint-override"><code> &lt;tbody data-bind='template: {name: "laborRowTemplate", foreach:
  laborLine}'&gt; &lt;/tbody&gt;
  
    &lt;script type="text/html" id="laborRowTemplate"&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;select data-bind='options: positions, optionsText:
  "Title",  optionsCaption: "select", value: selectedPosition '&gt;&lt;/
  select&gt;&lt;/td&gt;
  
          &lt;/tr&gt;
      &lt;/script&gt; 
  </code></pre>
  
  <p>Finally, thanks to Sean's comments below, I was able to get it working by modifying the code in the callback as follows:</p>
  
  <pre><code>success: function (msg) {
      projectViewModel.laborLine()[(projectViewModel.laborLine().length-1)].positionList(msg);
  }
  </code></pre>