<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Keeping modified records of EditorGridPanel while paging</title>
	<atom:link href="http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/</link>
	<description>For good of all productive developers</description>
	<lastBuildDate>Sun, 05 Feb 2012 09:37:22 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anon</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-4056</link>
		<dc:creator>Anon</dc:creator>
		<pubDate>Mon, 30 May 2011 05:18:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-4056</guid>
		<description>One note... In 3.3.1 as Corey stated... Duplicates appear in the modified array.  The link to the store is being broken simply using the code above.  It is very close, but not quite there.  The complete code to accomplish this without losing the link is below...


var modified	= store.getModifiedRecords();
this.modified	= [];
for (var x = 0; x &lt; modified.length; x++)
{
	var r	= store.getById(modified[x].id);

	if (r)
	{
		var changes	= modified[x].getChanges();
		for (p in changes)
		{
			if (changes.hasOwnProperty(p))
			{ r.set( p, changes[p] ); }
		}
	}
	else 
	{ this.modified.push(modified[x]); }
}</description>
		<content:encoded><![CDATA[<p>One note&#8230; In 3.3.1 as Corey stated&#8230; Duplicates appear in the modified array.  The link to the store is being broken simply using the code above.  It is very close, but not quite there.  The complete code to accomplish this without losing the link is below&#8230;</p>
<p>var modified	= store.getModifiedRecords();<br />
this.modified	= [];<br />
for (var x = 0; x &lt; modified.length; x++)<br />
{<br />
	var r	= store.getById(modified[x].id);</p>
<p>	if (r)<br />
	{<br />
		var changes	= modified[x].getChanges();<br />
		for (p in changes)<br />
		{<br />
			if (changes.hasOwnProperty(p))<br />
			{ r.set( p, changes[p] ); }<br />
		}<br />
	}<br />
	else<br />
	{ this.modified.push(modified[x]); }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Corey</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-4052</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Wed, 25 May 2011 06:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-4052</guid>
		<description>I don\\\&#039;t know why, but I was getting duplicate entries in the modified collection after I page out and page back. Mind you, I\\\&#039;m doing server-side paging.

So after getting the changes on this line:

var changes = modified[i].getChanges();

Remove the record like so:

store.modified.splice(i, 1);

And you\\\&#039;re sweet! It gets added again when you call set() on the record anyway.

Despite the fact I\\\&#039;d imagine that modified collection is meant to be private/protected, it works.</description>
		<content:encoded><![CDATA[<p>I don\\\&#8217;t know why, but I was getting duplicate entries in the modified collection after I page out and page back. Mind you, I\\\&#8217;m doing server-side paging.</p>
<p>So after getting the changes on this line:</p>
<p>var changes = modified[i].getChanges();</p>
<p>Remove the record like so:</p>
<p>store.modified.splice(i, 1);</p>
<p>And you\\\&#8217;re sweet! It gets added again when you call set() on the record anyway.</p>
<p>Despite the fact I\\\&#8217;d imagine that modified collection is meant to be private/protected, it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer Suarez</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-4038</link>
		<dc:creator>Jennifer Suarez</dc:creator>
		<pubDate>Thu, 07 Apr 2011 15:52:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-4038</guid>
		<description>Thank you for this! It is exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>Thank you for this! It is exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaaa</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-3687</link>
		<dc:creator>aaaa</dc:creator>
		<pubDate>Sat, 27 Feb 2010 11:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-3687</guid>
		<description>aaaaaaaaaaaaa</description>
		<content:encoded><![CDATA[<p>aaaaaaaaaaaaa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Defaite</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-3635</link>
		<dc:creator>Defaite</dc:creator>
		<pubDate>Mon, 02 Nov 2009 18:31:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-3635</guid>
		<description>You can modify this line :

var r = store.getById(modified[i].id);

by your own adaptation if you are an unique colum id :

var r = store.getAt(store.find(\&#039;name\&#039;, modified[i].data.name)) ;

Saki, modified[i].id, is changed after each loading (firebug).</description>
		<content:encoded><![CDATA[<p>You can modify this line :</p>
<p>var r = store.getById(modified[i].id);</p>
<p>by your own adaptation if you are an unique colum id :</p>
<p>var r = store.getAt(store.find(\&#8217;name\&#8217;, modified[i].data.name)) ;</p>
<p>Saki, modified[i].id, is changed after each loading (firebug).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saki</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-3460</link>
		<dc:creator>Saki</dc:creator>
		<pubDate>Fri, 02 Oct 2009 07:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-3460</guid>
		<description>See &lt;a target=&quot;_blank&quot; href=&quot;http://recordform.extjs.eu&quot; rel=&quot;nofollow&quot;&gt;RecordForm&lt;/a&gt; example, I&#039;ve copied the code from there. I hope that I haven&#039;t made a mistake... ;)</description>
		<content:encoded><![CDATA[<p>See <a target="_blank" href="http://recordform.extjs.eu" rel="nofollow">RecordForm</a> example, I&#8217;ve copied the code from there. I hope that I haven&#8217;t made a mistake&#8230; <img src='http://blog.extjs.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: preji</title>
		<link>http://blog.extjs.eu/patterns/code-patterns/keeping-modified-records-of-editorgridpanel-while-paging/comment-page-1/#comment-3441</link>
		<dc:creator>preji</dc:creator>
		<pubDate>Thu, 01 Oct 2009 10:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extjs.eu/?p=498#comment-3441</guid>
		<description>Am using below code but the data is not retaining while moving to another page

 var dsnew = new Ext.data.Store({
    proxy: new Ext.data.PagingMemoryProxy(dsgrid.reader.arrayData),
    remoteSort: true,  
    pruneModifiedRecords :false,   
    reader: new Ext.data.ArrayReader({},
        [
        {name: &#039;IsSlected&#039;,type: &#039;bool&#039;},    
        {name: &#039;RecNo&#039;,type: &#039;int&#039;},    
               
         ]),
        listeners:{
            update:{scope:this, fn:function(store) {
                var modified = store.getModifiedRecords();
                for(var i = 0; i &lt; modified.length; i++) {
                    var r = store.getById(modified[i].id);
                    if(r) {
                        var changes = modified[i].getChanges();
                        for(p in changes) {
                            if(changes.hasOwnProperty(p)) {
                            r.set(p, changes[p]);                                                       
                            
                            dsnew.refresh;                            
                        }
                    } // eo changes loop
                }
            } // eo modified loop
            }} // eo load listener
        } // eo listeners
     });</description>
		<content:encoded><![CDATA[<p>Am using below code but the data is not retaining while moving to another page</p>
<p> var dsnew = new Ext.data.Store({<br />
    proxy: new Ext.data.PagingMemoryProxy(dsgrid.reader.arrayData),<br />
    remoteSort: true,<br />
    pruneModifiedRecords :false,<br />
    reader: new Ext.data.ArrayReader({},<br />
        [<br />
        {name: 'IsSlected',type: 'bool'},<br />
        {name: 'RecNo',type: 'int'},    </p>
<p>         ]),<br />
        listeners:{<br />
            update:{scope:this, fn:function(store) {<br />
                var modified = store.getModifiedRecords();<br />
                for(var i = 0; i &lt; modified.length; i++) {<br />
                    var r = store.getById(modified[i].id);<br />
                    if(r) {<br />
                        var changes = modified[i].getChanges();<br />
                        for(p in changes) {<br />
                            if(changes.hasOwnProperty(p)) {<br />
                            r.set(p, changes[p]);                                                       </p>
<p>                            dsnew.refresh;<br />
                        }<br />
                    } // eo changes loop<br />
                }<br />
            } // eo modified loop<br />
            }} // eo load listener<br />
        } // eo listeners<br />
     });</p>
]]></content:encoded>
	</item>
</channel>
</rss>

