title: How to update observable array element in knockoutjs?
body: <p>I have following JavaScript array,</p>
  
  <pre><code>[{"unitPrice": 2499,"currency":"$","productId":1,"retailerId":1,"productName":"XX ","formattedPrice":"$ 2,499","productImage":"Images/2012_08_12_00_45_39_4539.jpg","productQuantity":"9","totalPrice":19992},
  {"unitPrice": 4999,"currency":"$","productId":2,"retailerId":1,"productName":"XX","formattedPrice":"$ 4,999","productImage":"Images/2012_08_12_00_46_45_4645.jpg","productQuantity":2,"totalPrice":9998},
  {"unitPrice":4555,"currency":"$","productId":1,"retailerId":1,"productName":"XXXXX","formattedPrice":"$ 4,555","productImage":"Images/2013_02_12_10_57_49_5749_9868.png","productQuantity":3,"totalPrice":13665}] 
  </code></pre>
  
  <p>here is the relevent html,</p>
  
  <pre><code>&lt;table&gt;
  &lt;tbody data-bind="foreach: $root"&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;img width="45" height="45" alt="" data-bind="attr:{src: productImage}"/&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;span data-bind="html: productName"&gt;&lt;/span&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;span data-bind="html: formattedPrice"&gt;&lt;/span&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="number" class="quantity" data-bind="value: productQuantity, attr:{'data-id': productId }"  /&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;span data-bind="html: totalPrice"&gt;&lt;/span&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Then I have created observable array as,</p>
  
  <pre><code>observableItems = ko.observableArray(items);
  ko.applyBindings(observableItems);
  </code></pre>
  
  <p>Now I was able to get an specfic element using,</p>
  
  <pre><code>       var obj = ko.utils.arrayFirst(list(), function (item) {
              return item.productId === id;
          });
  </code></pre>
  
  <p>However when I change,</p>
  
  <pre><code>item.productQuantity = 20;
  </code></pre>
  
  <p>But UI is not updating. Tried also,</p>
  
  <pre><code>item.productQuantity(item.productQuantity)
  </code></pre>
  
  <p>But getting error productQuantity is not a function</p>