title: KnockoutJS: Adding Observable Properties and Functions to objects in a mapping generated ObservableArray
body: <p>I'm new to <a href="http://knockoutjs.com" rel="nofollow noreferrer">KnockoutJS</a>, and I'm stuck trying to add additional properties and methods to the generated objects in the <code>ko.observableArray()</code> as created by the <code>mapping</code> plugin.</p>
  
  <p><br />
  <strong>Here's where I'm up to:</strong></p>
  
  <ul>
  <li>I have a JSON array of <code>Users</code></li>
  <li>I've created the <code>ko.observableArray()</code> with the mapping plugin</li>
  <li>I've got a template that creates table row for each <code>User</code>, so far so good  :o)</li>
  </ul>
  
  <p><br />
  <strong>Here's what I'm trying to do:</strong></p>
  
  <p>Each <code>User</code> has a property called <code>'IsActive'</code> - I'd like to <code>data-bind</code> a click event to a method on each <code>User</code> object that toggles this <code>'IsActive'</code> property.</p>
  
  <p><a href="https://stackoverflow.com/questions/6637579/knockoutjs-observablearray-and-ko-mapping-fromjs">This question looked promising</a>, but it seems like unnecessary duplication to me to have to declare the entire View Model in JS (unless that's the way I have to do it!) - is it possible to just extend the generated object?</p>
  
  <p><a href="http://janhartigan.com/articles/an-extension-to-the-knockout-js-mapping-plugin" rel="nofollow noreferrer">I was thinking more along these lines</a>, where there's a way to declare additional properties or methods, and have them extend the <code>mapping</code> generated objects, but this article is concerned with single objects rather than extending objects in a generated array.</p>
  
  <p><br />
  <strong>Here's the code:</strong> <a href="http://jsfiddle.net/yZkSf/2/" rel="nofollow noreferrer">http://jsfiddle.net/yZkSf/2/</a>  (not yet working in JS fiddle - but I'll keep playing with it and update this link when I get it working).</p>
  
  <p>Thank you for your help</p>