<?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: Example for CouchDB and jqgrid with inline editing, some advice needed</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/example-for-couchdb-and-jqgrid-with-inline-editing-some-advice-needed</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/example-for-couchdb-and-jqgrid-with-inline-editing-some-advice-needed/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>catshout on Example for CouchDB and jqgrid with inline editing, some advice needed</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/example-for-couchdb-and-jqgrid-with-inline-editing-some-advice-needed#p28482</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/example-for-couchdb-and-jqgrid-with-inline-editing-some-advice-needed#p28482</guid>
        	        	<description><![CDATA[<p>I&#39;m currently looking for an example that allows inline editing on a CouchDB with jqgrid. The code below is working but it doesn&#39;t update the CouchDB data when pressed the &#39;S&#39; button. I did some reseach but couldn&#39;t find anything helpful with regard to jqgrid and CouchDB.</p>
<p>Any hints are really appreciated.</p>
<p><strong>Database documents:</strong></p>
<p><a href="http://localhost/couchdb/example/_all_docs?&#038;limit=100&#038;include_docs=true" rel="nofollow" target="_blank"><a href="http://localhost/couchdb/examp" rel="nofollow">http://localhost/couchdb/examp</a>....._docs=true</a></p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9734' value='Select Code' data-codeid='sfcode9734' /></p>
<div class='sfcode' id='sfcode9734'>{&#34;total_rows&#34;:2,&#34;offset&#34;:0,&#34;rows&#34;:[<br />{&#34;id&#34;:&#34;43bce16e1dc49f9317b8921ff80013bf&#34;,&#34;key&#34;:&#34;43bce16e1dc49f9317b8921ff80013bf&#34;,&#34;value&#34;:{&#34;rev&#34;:&#34;1-e95711a1b37a7b4dbf6d3661e9eec530&#34;},&#34;doc&#34;:{&#34;_id&#34;:&#34;43bce16e1dc49f9317b8921ff80013bf&#34;,&#34;_rev&#34;:&#34;1-e95711a1b37a7b4dbf6d3661e9eec530&#34;,&#34;name&#34;:&#34;Gerald&#34;,&#34;message&#34;:&#34;Hello World!&#34;}},<br />{&#34;id&#34;:&#34;43bce16e1dc49f9317b8921ff8001510&#34;,&#34;key&#34;:&#34;43bce16e1dc49f9317b8921ff8001510&#34;,&#34;value&#34;:{&#34;rev&#34;:&#34;1-c7f45d42a23c4a93523dff9d2fc8ebfd&#34;},&#34;doc&#34;:{&#34;_id&#34;:&#34;43bce16e1dc49f9317b8921ff8001510&#34;,&#34;_rev&#34;:&#34;1-c7f45d42a23c4a93523dff9d2fc8ebfd&#34;,&#34;name&#34;:&#34;Sandra&#34;,&#34;message&#34;:&#34;Hello World too!&#34;}}<br />]}</div>
<p><strong>HTML for testing purposes</strong>:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4294' value='Select Code' data-codeid='sfcode4294' /></p>
<div class='sfcode' id='sfcode4294'>&#60;!doctype html&#62;<br />&#60;html&#62;<br />&#60;head&#62;<br />&#60;meta charset=&#34;utf-8&#34;&#62;<br />&#60;title&#62;Demo&#60;/title&#62;<br />&#60;/head&#62;<br />&#60;body&#62;<br />&#60;link rel=&#34;Stylesheet&#34; type=&#34;text/css&#34; href=&#34;css/smoothness/jquery-ui.custom.min.css&#34; /&#62;<br />&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/smoothness/ui.jqgrid.css&#34; /&#62;<br />&#60;script type=&#34;text/javascript&#34; src=&#34;js/jquery.min.js&#34;&#62;&#60;/script&#62;<br />&#60;script type=&#34;text/javascript&#34; src=&#34;js/jquery-ui.custom.min.js&#34;&#62;&#60;/script&#62;<br />&#60;script type=&#34;text/javascript&#34; src=&#34;js/grid.locale-en.js&#34;&#62;&#60;/script&#62;<br />&#60;script type=&#34;text/javascript&#34; src=&#34;js/jquery.jqGrid.min.js&#34;&#62;&#60;/script&#62;<br />&#60;script&#62;<br />$( document ).ready(function() {<br />&#160;&#160;&#160; //setup the grid<br />&#160;&#160;&#160; var lastsel;<br />&#160;&#160;&#160; $(&#34;#myGrid&#34;).empty().jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ajaxGridOptions: { contentType: &#39;application/json; charset=utf-8&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ajaxRowOptions: { contentType: &#39;application/json; charset=utf-8&#39;, type: &#34;PUT&#34; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url:&#39;/couchdb/example/_all_docs?&#38;limit=100&#38;include_docs=true&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;&#39;, &#39;Id&#39;, &#39;Name&#39;, &#39;Message&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [{name:&#39;act&#39;,index:&#39;act&#39;, width:75,sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;id&#39;, index: &#39;id&#39;, hidden: true, classes: &#39;id&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;doc.name&#39;, index: &#39;name&#39;, width: 500, editable:true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;doc.message&#39;, index: &#39;message&#39;, width: 200, editable:true }],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; repeatitems: false<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 832,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#34;100%&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; scrollOffset: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 10,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 15, 20, 25],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;name&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;asc&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; hoverrows: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#34;&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; /*<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; onSelectRow: function(id){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastsel){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#myGrid&#39;).jqGrid(&#39;restoreRow&#39;,lastsel);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#myGrid&#39;).jqGrid(&#39;editRow&#39;,id,true); lastsel=id;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; */<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridComplete: function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ids = jQuery(&#34;#myGrid&#34;).jqGrid(&#39;getDataIDs&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for(var i=0;i &#60; ids.length;i++){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cl = ids[i];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; be = &#34;&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;E&#39; onclick=&#34;jQuery(&#39;#myGrid&#39;).editRow(&#39;&#34;+cl+&#34;&#39;);&#34; /&#62;&#34;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; se = &#34;&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;S&#39; onclick=&#34;jQuery(&#39;#myGrid&#39;).jqGrid(&#39;saveRow&#39;, &#39;&#34;+cl+&#34;&#39;, false, &#39;clientArray&#39;);&#34; /&#62;&#34;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ce = &#34;&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;C&#39; onclick=&#34;jQuery(&#39;#myGrid&#39;).restoreRow(&#39;&#34;+cl+&#34;&#39;);&#34; /&#62;&#34;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#34;#myGrid&#34;).jqGrid(&#39;setRowData&#39;,ids[i],{act:be+se+ce});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; editurl: &#39;/couchdb/example&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //beforeSelectRow: function (rowid, e) { return false; } //this disables row being highlighted when clicked<br />&#160;&#160;&#160; });<br />});<br />&#60;/script&#62;<br />&#60;table id=&#34;myGrid&#34;&#62;&#60;tr&#62;&#60;td/&#62;&#60;/tr&#62;&#60;/table&#62; <br />&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62; <br />&#60;/body&#62;<br />&#60;/html&#62;</div>
]]></description>
        	        	<pubDate>Tue, 19 Mar 2013 17:52:53 +0200</pubDate>
        </item>
</channel>
</rss>