title: Sencha Touch: clone record
body: <p>I want to clone a Sencha Touch 2.3 Model instance (also called "record"). The clone should have the same id as the old one, but it should not be attached to any store. In ExtJS4, I would do the following and it would work:</p>
  
  <pre><code>var newRecord = record.copy();
  </code></pre>
  
  <p>This does not work in Sencha Touch. As per ST2 documentation, the new record gets a newly generated id on <a href="http://docs.sencha.com/touch/2.3.1/#!/api/Ext.data.Model-method-copy" rel="nofollow"><code>copy()</code></a>. So I tried:</p>
  
  <pre><code>var newRecord = record.copy(record.getId());
  </code></pre>
  
  <p>So now I should have a new copy with the same id. </p>
  
  <pre><code>newRecord.getId()==record.getId(); // returns true
  </code></pre>
  
  <p>I then modify the record:</p>
  
  <pre><code>newRecord.set("myCount",newRecord.get("myCount")+1);
  </code></pre>
  
  <p>Guess what happens next? I check that the records are really different:</p>
  
  <pre><code>newRecord.get("myCount")!=record.get("myCount"); // returns false
  </code></pre>
  
  <p>So, when I modified the "copy", I also modified the original, which means that no copy was created.</p>
  
  <p>What am I doing wrong, where did I misread the Sencha Touch docs?</p>