<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Using ui.sortable to save data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Reg on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18541</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18541</guid>
        	        	<description><![CDATA[<p>Thank you Emilio, I have made the change you suggest and it now works just the way I want it to.</p>
<p>Thanks again,</p>
<p>Reg</p>
]]></description>
        	        	<pubDate>Mon, 12 Jul 2010 17:39:38 +0300</pubDate>
        </item>
        <item>
        	<title>uyuni on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18530</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18530</guid>
        	        	<description><![CDATA[<p>correct is:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; var neworder = $("#tbloperatorgroups").jqGrid("getDataIDs").join(&#39;,&#39;);</p>
</p>
<p>Emilio</p>
]]></description>
        	        	<pubDate>Mon, 12 Jul 2010 00:35:54 +0300</pubDate>
        </item>
        <item>
        	<title>Reg on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18423</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18423</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>Thanks for the tip.</p>
<p>I now have the following:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7769' value='Select Code' data-codeid='sfcode7769' /></p>
<div class='sfcode' id='sfcode7769'>&#160;&#160;&#160; $(&#34;#tbloperatorgroups&#34;).jqGrid(&#39;sortableRows&#39;, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; update: function(event, ui) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var posturl = &#39;wc.dll?PSProcess~AjaxReseq~&#38;amp;Data=OperatorGroups&#38;amp;sk=2Z50G0BMF14352&#38;amp;sh=24&#39;;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var neworder = $(&#34;#tbloperatorgroups&#34;).jqGrid(&#34;getDataIDs&#34;); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.post( posturl, neworder, function(message,status) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(status != &#39;success&#39;) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(message); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }) <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; })</div>
<p>and the grid visually sorts and posts to the server, but neworder contains an array of $undefined=undefined (one for each row inthe grid)</p>
<p>If I change the&#160;"var neworder"&#160;line to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8944' value='Select Code' data-codeid='sfcode8944' /></p>
<div class='sfcode' id='sfcode8944'>var neworder = $(&#34;#tbloperatorgroups&#34;).getDataIDs();&#160;</div>
<p>I get the same result.</p>
<p>When I create the data, I include a &#60; row id &#62; element</p>
<p>What am I doing wrong?</p>
<p>Thanks,</p>
<p>Reg</p>
]]></description>
        	        	<pubDate>Tue, 06 Jul 2010 17:20:09 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18413</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18413</guid>
        	        	<description><![CDATA[<p>Hello Reg,</p>
<p>Instead of serialize I recommend you to use getDataIDs method to obtain the ids of the grid and post them to the server.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 06 Jul 2010 11:41:53 +0300</pubDate>
        </item>
        <item>
        	<title>Reg on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18330</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18330</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>Thanks for the re-direction. I have made the change to how I create the grid and the related calls, but am still missing something in my understanding. My code now looks like this:</p>
</p>
<p>&#160;&#160;&#160; $("#tbloperatorgroups").jqGrid(&#39;sortableRows&#39;, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; update: function(event, ui) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var posturl = &#39;wc.dll?PSProcess~AjaxReseq~&#38;amp;Data=OperatorGroups&#38;amp;sk=2YZ0HTYFD06840&#38;amp;sh=104&#39;;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var neworder = $("#tbloperatorgroups").sortable("serialize"); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.post( posturl, neworder, function(message,status) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(status != &#39;success&#39;) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(message); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }) <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; })</p>
<p>but&#160;neworder contains &#38;undefined = undefined</p>
</p>
<p>If I try to put an underscore in the name of the id attribute, the way the jQuery docs suggest, I get the same error.</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; var neworder = $("#tbloperatorgroups").sortable("serialize",[id=&#39;row_id&#39;]);</p>
</p>
<p>So I am still doing something wrong.</p>
</p>
<p>I still need some help, please.</p>
</p>
<p>Thanks</p>
<p>Reg</p>
]]></description>
        	        	<pubDate>Wed, 30 Jun 2010 20:36:31 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18320</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18320</guid>
        	        	<description><![CDATA[<p>Hello Reg,</p>
<p>The way that you use this is not correct. The sortable rows method should not be called in grid Complete event, but after the creation of the grid.</p>
<p>Go into the demo</p>
<p>New in version 3.6 =&#62; Sortable Row example</p>
<p>There is a code which will give you a idea.</p>
<p>Also you can set the update event in the same method</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4428' value='Select Code' data-codeid='sfcode4428' /></p>
<div class='sfcode' id='sfcode4428'>
<p>jQuery("#sortrows").jqGrid(&#39;sortableRows&#39;, {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; update: function (event, ui) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; ....</p>
<p>&#160;&#160;&#160;&#160;&#160; }</p>
<p>});</p>
</div>
<p>Hope this helps</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 30 Jun 2010 16:56:27 +0300</pubDate>
        </item>
        <item>
        	<title>Reg on Using ui.sortable to save data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18223</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/using-ui-sortable-to-save-data#p18223</guid>
        	        	<description><![CDATA[<p>I am just converting to ver 3.7 and want to use ui.sortable instead of tableDnD; what I cannot figure out is how to send the change to the server when a row has been dropped. What i have from the jQuery site (and the jGrid examples) is the following:</p>
<p>&#160;&#160;&#160;&#160;&#160; gridComplete : function () { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#tbloperatorgroups").jqGrid(&#39;sortableRows&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>....</p>
<p>&#160;&#160;&#160;&#160;$( "#tbloperatorgroups" ).bind( "sortupdate", function(event, ui) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var posturl = updating url ending with: &#38;amp;PK=&#39;+row.id;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var neworder = $.sortable.serialize(); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.post( posturl, neworder, function(message,status) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(status != &#39;success&#39;) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(message); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }) <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; ) ;</p>
</p>
<p>This code snippet has been copied from the tableDnD approach and may no longer be the way to do things. The error I get is that "row" (in the posturl) is unknown.&#160;</p>
<p>How do I include the ID of the moved row -- or do I not need to anymore? The documentation isn&#39;t very helpful on this.</p>
</p>
<p>Thanks</p>
<p>Reg</p>
]]></description>
        	        	<pubDate>Sun, 27 Jun 2010 19:52:53 +0300</pubDate>
        </item>
</channel>
</rss>