<?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: Save changes in DB using Sortablerows</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows</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/save-changes-in-db-using-sortablerows/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Save changes in DB using Sortablerows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30728</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30728</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>As far as I understand you will need to use this in the update event in sortable rows, so that you get the new order and send it to the server - as far as I understand the requierment.</p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Fri, 06 Jun 2014 12:08:56 +0300</pubDate>
        </item>
        <item>
        	<title>Bourne on Save changes in DB using Sortablerows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30716</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30716</guid>
        	        	<description><![CDATA[<p>thanks for your answer Tony</p>
<p>i need use getDataIDs before or after Update?</p>
<p>i'm newbie in javascript <img src="http://www.trirand.com/blog/wp-includes/images/smilies/icon_sad.gif" alt=":(" class="spWPSmiley" style="max-height:1em;margin:0"  /></p>
]]></description>
        	        	<pubDate>Mon, 02 Jun 2014 19:36:10 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Save changes in DB using Sortablerows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30713</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30713</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>In the update event you define you can get the new order of the id.<br />
To get the new ids you can use <strong>getDataIDs</strong> grid method.</p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Mon, 02 Jun 2014 17:11:10 +0300</pubDate>
        </item>
        <item>
        	<title>Bourne on Save changes in DB using Sortablerows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30705</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/save-changes-in-db-using-sortablerows#p30705</guid>
        	        	<description><![CDATA[<p>Hello guys, im starting in javascript world and need your help</p>
<p>i'm using jqgrid to get data from my server, this data now in my grid and usind sortablerows to move the rows, the problem is that i need save new order in the DB.</p>
<p>i need save the info using get submit.</p>
<p>Ex.Â urlService +"guardarCambios?callback=?"</p>
<p>urlService: url where is my webservice</p>
<p>guardarCambios?callback=? here call my method to send data, my code is this.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5308' value='Select Code' data-codeid='sfcode5308' /></p>
<div class='sfcode' id='sfcode5308'>$(function(){</p>
<p>jQuery(&#34;#list&#34;).jqGrid({<br />
url: urlService+&#34;llamarDatos?callback=?&#34;,<br />
postData:{Programa:programa},<br />
datatype: &#34;json&#34;,<br />
mtype: &#34;GET&#34;,<br />
colNames: ['Orden','Nombre','PosiciÃ³n','Tipo' ,'','&#60;input name=&#34;guardar&#34; type=&#34;image&#34;  src=&#34;Resources/bt_mas.png&#34; onclick=nuevapromocion(); width=20 height=20/&#62;'],<br />
colModel: [ { name:'orden', index: 'orden',sortable:false, width: 30 ,resizable:true, hidden:false},<br />
            { name:'nombre', index: 'nombre',sortable:false, width: 100 ,resizable:true},<br />
            { name:'posicion', index: 'posicion',sortable:false, width: 100 ,resizable:true},<br />
            { name:'tipo', index: 'tipo',sortable:false, width: 70 ,resizable:false},<br />
            { name:'Action',width: 30, sortable: false, classes: 'action', align: 'center',resizable:false},<br />
            { name:'Action2',width:30,align:'center',resizable:false,sortable:false,},<br />
            ],<br />
rowNum: 10,<br />
loadonce:true,<br />
pager: jQuery('#pager'),<br />
height: 'auto',<br />
width: 525,<br />
viewrecords: false,<br />
sortorder: &#34;desc&#34;,<br />
gridComplete:function(){<br />
             var pIDs = jQuery(&#34;#list&#34;).jqGrid('getDataIDs');   </p>
<p>             for(var i=0; i&#60;pIDs.length; i++){<br />
                 var option='';<br />
                 var cl = pIDs[i];<br />
                 fila = jQuery(&#34;#list&#34;).jqGrid('getRowData', pIDs[i]);<br />
                 position = fila.posicion;<br />
                 orden = fila.orden;<br />
                 btnDelete = &#34;&#60;input style='height:22px;' type='image' src=\&#34;Resources/btn_borrar.png\&#34; onclick=eliminar(&#34;+cl+&#34;); float=\&#34;center\&#34;/&#62;&#34;;<br />
                 btnEdit = &#34;&#60;input style='height:22px;' type='image' src=\&#34;Resources/btn_editar.png\&#34; onclick=\&#34;editar(&#34;+cl+&#34;)\&#34; float=\&#34;center\&#34;/&#62;&#34;;<br />
                 if(position==&#34;Arriba Izquierda&#34; &#124;&#124; orden=='1'){<br />
                    jQuery(&#34;#list&#34;).jqGrid('setRowData',pIDs[i],{Action:btnEdit});<br />
                 }<br />
                 else{<br />
                      jQuery(&#34;#list&#34;).jqGrid('setRowData',pIDs[i],{Action:btnEdit});<br />
                      jQuery(&#34;#list&#34;).jqGrid('setRowData',pIDs[i],{Action2:btnDelete});<br />
                 }<br />
             }<br />
        }<br />
});</p>
<p>$(&#34;#list&#34;).jqGrid('sortableRows',<br />
{<br />
  update : function(e,ui) {  </p>
<p>$.getJSON(urlService+&#34;guardarCambios?callback=?&#34;,{id:ui.item[0].id,orden:ui.item[0].rowIndex,Programa:programa},<br />
             function(data){<br />
             jQuery(&#34;#list&#34;).setGridParam({sortorder: &#34;asc&#34;}).jqGrid(&#34;sortGrid&#34;, &#34;order_index&#34;, true);<br />
             jQuery(&#34;#list&#34;).trigger(&#34;reloadGrid&#34;);<br />
            });</p>
<p>               alert(&#34;item with id=&#34; + ui.item[0].id + &#34; is droped&#34;);<br />
           }});<br />
});</p>
</div>
<p>i need thisÂ <a href="http://www.webresourcesdepot.com/wp-content/uploads/file/jquerydragdrop/" target="_blank">Demo</a></p>
]]></description>
        	        	<pubDate>Fri, 30 May 2014 17:13:44 +0300</pubDate>
        </item>
</channel>
</rss>