<?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: Id from server</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server</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/id-from-server/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>ww9rivers on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p6953</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p6953</guid>
        	        	<description><![CDATA[<p>Cool! I got it to work following this thread with edit and delete functions with the right "id" I need.</p>
<p>Thanks!</p>
<p><input id="gwProxy" type="hidden"/><!--Session data--><input id="jsProxy" onclick="jsCall();" type="hidden" /></p>
]]></description>
        	        	<pubDate>Thu, 28 May 2009 10:21:53 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2218</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2218</guid>
        	        	<description><![CDATA[<p>Thanks Tony but it does not work.</p>
<p>Anyway I pass the id using editData in the beforeSubmit event and works ok...</p>
]]></description>
        	        	<pubDate>Wed, 24 Sep 2008 08:49:56 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2212</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2212</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I think you mixed colModel with the real JSON data in the jsonReader.</p>
<p>Try with the default options of jsonReader - i.e. do not set in your grid</p>
</p>
<p>Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Wed, 24 Sep 2008 04:05:03 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2190</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2190</guid>
        	        	<description><![CDATA[<p>I have:</p>
<p>I have:</p>
<p>rows :[<br />{id: "11",cell:["11","ADMISTRACI&#211;N LEGAL Y FINANZAS"]},<br />{id: "4",cell:["4","ASEGURADORA, ARREDADORA FINANCIERA Y OTROS AFINES"]},<br />{id: "16",cell:["16","CAJA DE AHORRO, COOPERATIVA O AFINES"]},<br />{id: "10",cell:["10","CENTROS EDUCATIVOS Y AFINES"]},<br />{id: "2",cell:["2","COMERCIALIZADORA DE PRODUCTOS ELECTR&#211;DOMESTICOS, COMPUTACI&#211;N, MAN"]},<br />{id: "1",cell:["1","EDITORIAL, VENTA DE LIBROS (MAYOR O DETAL) Y AFINES"]},<br />{id: "14",cell:["14","EMPRESAS DE CONSULTOR&#205;A, DESARROLLO DE SOFTWARE Y AFINES"]},<br />{id: "17",cell:["17","EMPRESAS DE SERVICIOS EN GENERAL"]},<br />{id: "15",cell:["15","FUNDACI&#211;N SIN FINES DE LUCRO"]},<br />{id: "9",cell:["9","INMOBILIARIAS, ADMINISTRADORAS DE BIENES RA&#205;CES Y AFINES"]}<br />]}</p>
<p>And in my grid i have</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;Codigo&#39;,&#39;Nombre&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel :[ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: "co_sector", index: "co_sector", key: true, width: 20, editable: false, search: false, hidden:true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: "nb_sector", index: "nb_sector", width: 90, editable: true, editoptions: {size: "60", maxlength: "60"}, editrules:{requerided:true}} <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems : true,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: "co_sector"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>But I don&#39;t receive "co_sector" when edit or delete a row...</p>
]]></description>
        	        	<pubDate>Tue, 23 Sep 2008 10:53:23 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2170</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2170</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>to be correct you JSON response should look like:</p>
<p>&#8220;rows&#8221; :[<br />&#160; &#160;&#160;&#160; {"id": "11","cell":["11","ADMISTRACI&#211;N LEGAL Y FINANZAS"]}<br />&#160;]}</p>
]]></description>
        	        	<pubDate>Mon, 22 Sep 2008 17:24:36 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2161</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2161</guid>
        	        	<description><![CDATA[<p>Sorry Tony,</p>
<p>I still receive the row number as id and not the primary key value...</p>
]]></description>
        	        	<pubDate>Mon, 22 Sep 2008 10:35:02 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2123</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2123</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Try with this</p>
<p>jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems : true,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: "id"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
</p>
<p>There is a bug when id:"0" (only) since java interpret "0" as false.</p>
<p>I have corrected this.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 19 Sep 2008 01:00:08 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2117</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2117</guid>
        	        	<description><![CDATA[<p>My jsonReader is:</p>
<p>jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems : true,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: "0"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
]]></description>
        	        	<pubDate>Thu, 18 Sep 2008 17:13:44 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2092</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2092</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>How looks your jsonReader like?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 18 Sep 2008 09:21:11 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2081</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2081</guid>
        	        	<description><![CDATA[<p>I apply those changes to my code but still I received the row num instead the primary key in the id parameter in an "edit" action. I build my json data as :</p>
<p>&#160;rows :[<br />&#160; &#160;&#160;&#160; {id: "11",cell:["11","ADMISTRACI&#211;N LEGAL Y FINANZAS"]}<br />&#160;]}</p>
<p>And, say, this is the row 3 when i show those data in the grid and when I edit i received the "id" parameter as "3" and not as "11"...</p>
<p>why ?</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 13:26:40 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2080</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2080</guid>
        	        	<description><![CDATA[<p>Did you see the difference ?</p>
<p><strong>&#60;row ID=&#8221;3&#8243;&#62;</strong></p>
<p>should be</p>
<p>&#60;row id=&#8221;3&#8243;&#62;</p>
<p>or change the xmlReader to read the ID instead of id</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 11:19:12 +0300</pubDate>
        </item>
        <item>
        	<title>shlang on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2078</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2078</guid>
        	        	<description><![CDATA[<p>I return from server xml without any names:</p>
<p>&#60;row ID="3"&#62;<br />&#60;cell&#62;3&#60;/cell&#62;<br />&#60;cell&#62;Alex Bokun&#60;/cell&#62;<br />&#60;cell&#62;+5296418677&#60;/cell&#62;<br />&#60;cell&#62;Gsmart 300&#60;/cell&#62;<br />&#60;cell&#62;34523452345&#60;/cell&#62;<br />&#60;cell&#62;Inactive&#60;/cell&#62;<br />&#60;/row&#62;</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 11:07:13 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2074</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2074</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thank you for this, but sorry this is not a bug.</p>
<p>The for statement is called after constructing the multiselect and subgrid</p>
<p>additinal columns, so this must work - check your code again.</p>
<p>Check your server code again and pay attention on what you return from</p>
<p>server -&#160; Is the name exactly as those from colModel.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 10:46:20 +0300</pubDate>
        </item>
        <item>
        	<title>shlang on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2068</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2068</guid>
        	        	<description><![CDATA[<p>I found a bug. In grid.base.js we have</p>
<p>&#160; &#160;&#160;&#160; for (var i=0; i&#60;ts.p.colModel.length;i++) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if (ts.p.colModel[i].key===true) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ts.p.keyIndex = i;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; i++;<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>So because of two increments my key column was skipped. I changed it to</p>
<p>if(ts.p.multiselect) n=1;<br />else n=0;<br />&#160;&#160;&#160; &#160;&#160;&#160; for(i=0;i&#60;this.p.colNames.length;i++){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if (ts.p.colModel[i+n].key===true) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ts.p.keyIndex = i;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>Now it works 🙂</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 09:44:16 +0300</pubDate>
        </item>
        <item>
        	<title>YamilBracho on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2067</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2067</guid>
        	        	<description><![CDATA[<p>Hi.<br />My colModes is as follows:</p>
<p>&#160;&#160; colModel :[ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: "co_sector", index: "co_sector", width: 20, editable: true, search: false },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: "nb_sector", index: "nb_sector", width: 90, editable: true, editoptions: {size: "60", maxlength: "60"}, editrules:{requerided:true}} <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160;&#160;&#160; &#160;<br />And I hides the "co_sector" (that it is my PK)</p>
<p>jQuery("#list").hideCol(["co_sector"]);&#160; &#160;</p>
<p>When I submit the data in a "edit" action I receive the co_sector as part of the QueryString.</p>
<p>For delete operation I just add the "co_sector" data in the beforeSubmit method of the delete options. My code is:</p>
<p>&#160;{ height:90, width:300,&#160; reloadAfterSubmit:false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; beforeSubmit: function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var sr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rowData = jQuery("#list").getRowData(sr);<br />&#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;&#160;&#160;&#160;&#160; this.delData = {"co_sector" : rowData[&#39;co_sector&#39;]};<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; retarr = {"co_sector" : rowData[&#39;co_sector&#39;]};<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return retarr; <br />&#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; }, // del options </p>
<p>HTH</p></p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 09:26:29 +0300</pubDate>
        </item>
        <item>
        	<title>shlang on Id from server</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2066</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/id-from-server#p2066</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Please explain me how to use id sent from server...</p>
<p>i have</p>
<p>{name:&#39;UserId&#39;, key: true, index:&#39;users.UserId&#39;, width:30, sorttype:"int"}</p>
<p>in my colmodel. but when editing or deleting server gets parameter id={number of current row}. But i need userId...</p>
]]></description>
        	        	<pubDate>Wed, 17 Sep 2008 08:27:41 +0300</pubDate>
        </item>
</channel>
</rss>