<?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: rowpos not working correctly</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly</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/bugs/rowpos-not-working-correctly/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>nickelj on rowpos not working correctly</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21160</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21160</guid>
        	        	<description><![CDATA[<p>In case any one else runs into this, I found my fix.</p>
<p>It wasn&#39;t obvious to me, but you have to have the&#160;colName, colModel and the SQL return statements all return the fields in the exact same order - even if you are going to rearrange the rowpos/colpos.</p>
<p>For example:</p>
<p>colModel =</p>
<p>&#160;&#160;&#160; {name:&#39;id&#39;, index:&#39;id&#39;, width:55, sortable:true, formatter:addSpace, unformat:removeSpace, editable:true,&#160; editoptions:{readonly:true, title:&#39;The customers number. This field is automatically assigned and is not editable.&#39;}, formoptions:{label:"Cust ID", rowpos:1}},<br />&#160;&#160;&#160; {name:&#39;author&#39;, index:&#39;author&#39;, width:75, align:&#39;center&#39;, editable:true, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}, defaultValue:&#39;N&#39;, title:&#39;Select whether this customer is a author or not.&#39;}, formoptions:{rowpos:2}},<br />&#160;&#160;&#160; {name:&#39;chapters&#39;, index:&#39;chapters&#39;, width:75, align:&#39;center&#39;, editable:true, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}, defaultValue:&#39;N&#39;, title:&#39;Select whether this customer sells to Chapters or not (should also be an author if this is Yes).&#39;}, formoptions:{rowpos:3}},<br />&#160;&#160;&#160; {name:&#39;name&#39;, index:&#39;name&#39;, width:220, searchoptions: {sopt:[&#39;cn&#39;]}, formatter:addSpace, unformat:removeSpace, editable:true, editoptions:{size:40, maxlength:40}, formoptions:{label:"Name", rowpos:4}},<br />&#160;&#160;&#160; {name:&#39;homephone&#39;, index:&#39;homephone&#39;, width:110, searchoptions: {sopt:[&#39;cn&#39;]}, formatter:addSpace, unformat:removeSpace, editable:true, formoptions:{rowpos:12}},<br />&#160;&#160;&#160; {name:&#39;attention&#39;, index:&#39;attention&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:5}},<br />&#160;&#160;&#160; {name:&#39;address&#39;, index:&#39;address&#39;, width:250, searchoptions: {sopt:[&#39;cn&#39;]}, search:true, hidden:false, formatter:addSpace, unformat:removeSpace, editable:true, editrules:{edithidden:true, required:true}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:6}},<br />&#160;&#160;&#160; {name:&#39;address2&#39;, index:&#39;address2&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:7}},<br />&#160;&#160;&#160; {name:&#39;city&#39;, index:&#39;city&#39;, width:130, formatter:addSpace, unformat:removeSpace, editable:true, searchoptions: {sopt:[&#39;cn&#39;]}, formoptions:{rowpos:8}},&#160;&#160;&#160; <br />&#160;&#160;&#160; {name:&#39;prov&#39;, index:&#39;prov_state&#39;, width:40, editable:true, hidden:true, editrules:{edithidden:true}, formoptions:{rowpos:9, elmsuffix:"&#38;nbsp;&#38;nbsp;&#60;font size=&#39;0px&#39;&#62;&#60;a href=&#39;#&#39; class=&#39;ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all&#39; style=&#39;padding:0px;&#39; title=&#39;Province Lookup&#39; onmouseover=&#39;$(this).addClass("ui-state-hover");&#39; onmouseout=&#39;$(this).removeClass("ui-state-hover");&#39; onClick=&#39;ShowBrowse("state_browse", 200, 1230, 364, 324);&#39;&#62;&#60;span class=&#39;ui-button-icon-primary ui-icon ui-icon-newwin&#39;&#62;&#60;/span&#62;&#60;span class=&#39;ui-button-text&#39;&#62;Province Lookup&#60;/span&#62;&#60;/a&#62;&#60;/font&#62;"}},<br />&#160;&#160;&#160; {name:&#39;country&#39;, index:&#39;country&#39;, width:180, editable:true, hidden:true, editrules:{edithidden:true}, formoptions:{rowpos:10, elmsuffix:"&#38;nbsp;&#38;nbsp;&#60;font size=&#39;0px&#39;&#62;&#60;a href=&#39;#&#39; class=&#39;ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all&#39; style=&#39;padding:0px;&#39; title=&#39;Country Lookup&#39; onmouseover=&#39;$(this).addClass("ui-state-hover");&#39; onmouseout=&#39;$(this).removeClass("ui-state-hover");&#39; onClick=&#39;ShowBrowse("country_browse", 200, 1230, 184, 330);&#39;&#62;&#60;span class=&#39;ui-button-icon-primary ui-icon ui-icon-newwin&#39;&#62;&#60;/span&#62;&#60;span class=&#39;ui-button-text&#39;&#62;Country Lookup&#60;/span&#62;&#60;/a&#62;&#60;/font&#62;"}},<br />&#160;&#160;&#160; {name:&#39;postal_zip&#39;, index:&#39;postal_zip&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:9, maxlength:10}, formoptions:{rowpos:11}},<br />&#160;&#160;&#160; {name:&#39;officephone&#39;, index:&#39;officephone&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:13}},<br />&#160;&#160;&#160; {name:&#39;fax&#39;, index:&#39;fax&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:14}},<br />&#160;&#160;&#160; {name:&#39;cellphone&#39;, index:&#39;cellphone&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:15}},<br />&#160;&#160;&#160; {name:&#39;email&#39;, index:&#39;email&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:16}},<br />&#160;&#160;&#160; {name:&#39;reseller_discount&#39;, index:&#39;reseller_discount&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:3, maxlength:3}, formoptions:{rowpos:17}},<br />&#160;&#160;&#160; {name:&#39;author_discount&#39;, index:&#39;author_discount&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:3, maxlength:3}, formoptions:{rowpos:18}},<br />&#160;&#160;&#160; {name:&#39;collect_gst&#39;, index:&#39;collect_gst&#39;, width:75, align:&#39;center&#39;, hidden:true, editable:true, editrules:{edithidden:true, required:false}, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}, defaultValue:&#39;N&#39;, title:&#39;Select whether this customer (usually a author) collects GST or not - most authors are No.&#39;}, formoptions:{rowpos:19}},<br />&#160;&#160;&#160; {name:&#39;pay_gst&#39;, index:&#39;pay_gst&#39;, width:75, align:&#39;center&#39;, hidden:true, editable:true, editrules:{edithidden:true, required:false}, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}, defaultValue:&#39;Y&#39;, title:&#39;Select whether this customer pays GST or not.&#39;}, formoptions:{rowpos:20}},<br />&#160;&#160;&#160; {name:&#39;pay_shipping&#39;, index:&#39;pay_shipping&#39;, width:75, align:&#39;center&#39;, hidden:true, editable:true, editrules:{edithidden:true, required:false}, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}, defaultValue:&#39;Y&#39;, title:&#39;Select whether this customer pays shipping or not.&#39;}, formoptions:{rowpos:21}},<br />&#160;&#160;&#160; {name:&#39;notes&#39;, index:&#39;notes&#39;, width:110, hidden:true, editable:true, edittype:"textarea", unformat:returnVal, editrules:{edithidden:true, required:false}, editoptions:{rows:"10", cols:"40"}, formoptions:{rowpos:22}}</p>
</p>
<p>colNames =</p>
<p>&#160;&#160; colNames: [&#39;#&#39;, &#39;Author&#39;, &#39;Chapters&#39;, &#39;Name&#39;, &#39;Home Phone&#39;, &#39;Attention&#39;, &#39;Address&#39;, &#39;Address2&#39;, &#39;City&#39;, &#39;Prov/State&#39;, &#39;Country&#39;, &#39;Postal Code&#39;, &#39;Office Phone&#39;, &#39;Fax&#39;, &#39;Cell&#39;, &#39;EMail&#39;, &#39;Reseller Discount&#39;, &#39;Author Discount&#39;, &#39;Collects GST&#39;, &#39;Pays GST&#39;, &#39;Pays Shipping&#39;, &#39;Notes&#39;],</p>
</p>
<p>And the SQL statement would look like:</p>
<p>SELECT id, author, chapters, C.name, homephone, attention, address, address2, city, prov_state, country, postal_zip, officephone, fax, cellphone, email, reseller_discount, author_discount, collect_gst, pay_gst, pay_shipping, notes FROM customers C&#160; ORDER BY name asc LIMIT 30 OFFSET 0</p>
</p>
<p>Hope this helps,</p>
</p>
<p>Jim</p>
]]></description>
        	        	<pubDate>Sun, 05 Dec 2010 19:15:08 +0200</pubDate>
        </item>
        <item>
        	<title>nickelj on rowpos not working correctly</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21159</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21159</guid>
        	        	<description><![CDATA[<p>No answer? No fix?</p>
<p>I have this same problem with several different pages - fields appear in a completely different sequence than what I specify.</p>
</p>
<p>Jim</p>
]]></description>
        	        	<pubDate>Sun, 05 Dec 2010 19:00:02 +0200</pubDate>
        </item>
        <item>
        	<title>nickelj on rowpos not working correctly</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21009</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/rowpos-not-working-correctly#p21009</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>If I use this colModel code:</p>
<p>&#8230;</p>
<pre id="line36">url: &#39;index.php&#39;,
    editurl: &#39;index.php&#39;,
    datatype: &#39;json&#39;,
    mtype: &#39;GET&#39;,
    autoencode: true,
    colNames: [&#39;#&#39;, &#39;Author&#39;, &#39;Name&#39;, &#39;Home Phone&#39;, &#39;Attention&#39;, &#39;Address&#39;, &#39;Address2&#39;, &#39;City&#39;, &#39;Prov/State&#39;, &#39;Country&#39;, &#39;Postal Code&#39;, &#39;Office Phone&#39;, &#39;Fax&#39;, &#39;Cell&#39;, &#39;EMail&#39;, &#39;Discount&#39;, &#39;Notes&#39;],
    colModel:[
       {name:&#39;id&#39;, index:&#39;id&#39;, width:55, sortable:true, formatter:addSpace, unformat:removeSpace, editable:true,  editoptions:{readonly:true}, formoptions:{label:"Cust ID", rowpos:1}},
    {name:&#39;author&#39;, index:&#39;author&#39;, width:75, align:&#39;center&#39;, editable:true, edittype:&#39;select&#39;, editoptions:{value:{Y:&#39;Yes&#39;,N:&#39;No&#39;}}, formoptions:{rowpos:2}},
    {name:&#39;name&#39;, index:&#39;name&#39;, width:220, searchoptions: {sopt:[&#39;cn&#39;]}, formatter:addSpace, unformat:removeSpace, editable:true, editoptions:{size:40, maxlength:40}, formoptions:{label:"Name", rowpos:3}},
    {name:&#39;homephone&#39;, index:&#39;homephone&#39;, width:110, searchoptions: {sopt:[&#39;cn&#39;]}, formatter:addSpace, unformat:removeSpace, editable:true, formoptions:{rowpos:11}},
    {name:&#39;address&#39;, index:&#39;address&#39;, width:250, searchoptions: {sopt:[&#39;cn&#39;]}, search:true, hidden:false, formatter:addSpace, unformat:removeSpace, editable:true, editrules:{edithidden:true, required:true}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:5}},
    {name:&#39;address2&#39;, index:&#39;address2&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:6}},
    {name:&#39;attention&#39;, index:&#39;attention&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:4}},
    {name:&#39;city&#39;, index:&#39;city&#39;, width:130, formatter:addSpace, unformat:removeSpace, editable:true, searchoptions: {sopt:[&#39;cn&#39;]}, formoptions:{rowpos:7}},    
    {name:&#39;prov&#39;, index:&#39;prov_state&#39;, width:40, editable:true, hidden:true, editrules:{edithidden:true}, formoptions:{rowpos:8, elmsuffix:"&#38;nbsp;&#38;nbsp;&#60;font size=&#39;0px&#39;&#62;&#60;a href=&#39;#&#39; class=&#39;ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all&#39; style=&#39;padding:0px;&#39; title=&#39;Province Lookup&#39; onmouseover=&#39;$(this).addClass("ui-state-hover");&#39; onmouseout=&#39;$(this).removeClass("ui-state-hover");&#39; onClick=&#39;ShowBrowse("state_browse", 200, 1230, 362, 323);&#39;&#62;&#60;span class=&#39;ui-button-icon-primary ui-icon ui-icon-newwin&#39;&#62;&#60;/span&#62;&#60;span class=&#39;ui-button-text&#39;&#62;Province Lookup&#60;/span&#62;&#60;/a&#62;&#60;/font&#62;"}},
    {name:&#39;country&#39;, index:&#39;country&#39;, width:180, editable:true, hidden:true, editrules:{edithidden:true}, formoptions:{rowpos:9, elmsuffix:"&#38;nbsp;&#38;nbsp;&#60;font size=&#39;0px&#39;&#62;&#60;a href=&#39;#&#39; class=&#39;ui-button ui-button-icon-only ui-widget ui-state-default ui-corner-all&#39; style=&#39;padding:0px;&#39; title=&#39;Country Lookup&#39; onmouseover=&#39;$(this).addClass("ui-state-hover");&#39; onmouseout=&#39;$(this).removeClass("ui-state-hover");&#39; onClick=&#39;ShowBrowse("state_browse", 200, 1230, 372, 330);&#39;&#62;&#60;span class=&#39;ui-button-icon-primary ui-icon ui-icon-newwin&#39;&#62;&#60;/span&#62;&#60;span class=&#39;ui-button-text&#39;&#62;Country Lookup&#60;/span&#62;&#60;/a&#62;&#60;/font&#62;"}},
    {name:&#39;postal_zip&#39;, index:&#39;postal_zip&#39;, width:130, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:9, maxlength:10}, formoptions:{rowpos:10}},
    {name:&#39;officephone&#39;, index:&#39;officephone&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:12}},
    {name:&#39;fax&#39;, index:&#39;fax&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:13}},
    {name:&#39;cellphone&#39;, index:&#39;cellphone&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:20, maxlength:20}, formoptions:{rowpos:14}},
    {name:&#39;email&#39;, index:&#39;email&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:40, maxlength:40}, formoptions:{rowpos:15}},
    {name:&#39;default_discount&#39;, index:&#39;default_discount&#39;, width:110, hidden:true, editable:true, editrules:{edithidden:true, required:false}, editoptions:{size:3, maxlength:3}, formoptions:{rowpos:16}},
    {name:&#39;notes&#39;, index:&#39;notes&#39;, width:110, hidden:true, editable:true, edittype:"textarea",unformat:returnVal, editrules:{edithidden:true, required:false}, editoptions:{rows:"10", cols:"40"}, formoptions:{rowpos:17}}

    ],
    pager: &#39;#customer_livegrid_pager&#39;,
    postData: {gridname:&#39;customer_livegrid&#39;},
    height: 440,
    rowNum: 30,
    scroll: 1,
    altRows: true,
...</pre>
<pre>I expected to see the form with the fields in this order:</pre>
<pre>Cust ID,</pre>
<pre>Author,</pre>
<pre>Name,</pre>
<pre>Attention,</pre>
<pre>Address,</pre>
<pre>Address2,</pre>
<pre>City,</pre>
<pre>Prov,</pre>
<pre>etc..</pre>
<pre>However, the edit form appears with the fields out of the correct sequence....like this:</pre>
<pre><a href="http://www.digitaldigs.ca/Example.jpg"><img src="http://www.digitaldigs.ca/Example.jpg" width="100"  class="sfimageleft spUserImage" alt="Edit Form with Fields in wrong order" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></pre>
<pre>And if I submit the data, I get this in the _POST vars:</pre>
<pre>&#160;&#160;&#160; _POST VARS<br />&#160;&#160;&#160; id =&#62;&#160; 3<br />&#160;&#160;&#160; author =&#62;&#160; Y<br />&#160;&#160;&#160; name =&#62;&#160; Name line<br />&#160;&#160;&#160; attention =&#62;&#160; Address2 line<br />&#160;&#160;&#160; address =&#62;&#160; Attention line<br />&#160;&#160;&#160; address2 =&#62;&#160; Address line<br />&#160;&#160;&#160; city =&#62;&#160; City Line<br />&#160;&#160;&#160; prov =&#62;&#160; Prov<br />&#160;&#160;&#160; country =&#62;&#160; Country<br />&#160;&#160;&#160; postal_zip =&#62;&#160; Postal<br />&#160;&#160;&#160; homephone =&#62;&#160; Home Phone<br />&#160;&#160;&#160; officephone =&#62;&#160; Office Phone<br />&#160;&#160;&#160; fax =&#62;&#160; Fax<br />&#160;&#160;&#160; cellphone =&#62;&#160; Cell phone<br />&#160;&#160;&#160; email =&#62;&#160; email address<br />&#160;&#160;&#160; default_discount =&#62;&#160; 20<br />&#160;&#160;&#160; notes =&#62;&#160; These are some notes<br />&#160;&#160;&#160; oper =&#62;&#160; edit<br />&#160;&#160;&#160; pagename =&#62;&#160; customer_edit<br /></pre>
<pre><br /></pre>
<pre>As you can see, the data is not correlated with the correct field.</pre>
<pre>What am I doing wrong....or is this a bug in the JQGrid?</pre>
<pre>Thanks,</pre>
<pre>Jim<br /></pre>
]]></description>
        	        	<pubDate>Fri, 26 Nov 2010 03:03:17 +0200</pubDate>
        </item>
</channel>
</rss>