<?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: Grid Column and Cell width differences when using setRowData on gridComplete</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/grid-column-and-cell-width-differences-when-using-setrowdata-on-gridcomplete</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/grid-column-and-cell-width-differences-when-using-setrowdata-on-gridcomplete/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>syntaxritual on Grid Column and Cell width differences when using setRowData on gridComplete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-column-and-cell-width-differences-when-using-setrowdata-on-gridcomplete#p16389</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-column-and-cell-width-differences-when-using-setrowdata-on-gridcomplete#p16389</guid>
        	        	<description><![CDATA[<p>*********************</p>
<p>edit: Figured it out, in the code that isn&#39;t a sample im using some server side</p>
<p>stuff to determine whether nor not this col gets added, I had forgotten to add</p>
<p>an empty &#60;cell&#62; in the xml that is my grid data, to compensate for the additional</p>
<p>column in the grid.</p>
<p>*********************</p>
<p>Hey guys,&#160;</p>
<p>I am trying to add a button into my grid that I am going to add a custom .click to&#8230;</p>
<p>I&#39;ve got the button showing up, but the widths of my cells are now off a bit.</p>
<p>Below is basically what im doing.</p>
<p>Attached is a screenshot where you can see what I am talking about.</p>
<p>Anyone know what I may be doing wrong?</p>
</p>
<p>EDIT: It seems that the values in my "leano" column are being replaced by my "Approve" buttons&#8230;</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;Is there an error in my usage of setRowData ?</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;jQuery("#mygrid").jqGrid(&#39;setRowData&#39;,ids[i],{act:be});</p>
</p>
<p>You may need to view the image in a new window or tab to view it in its normal dimensions.</p>
<p><a href="http://moartentacles.com/grid_misalign.png"><img src="http://moartentacles.com/grid_misalign.png" width="100"  class="sfimageleft spUserImage" alt="gridwoes" /><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></p>
<p>jQuery(document).ready(function(){</p>
<p>&#160;&#160; &#160;jQuery("#mygrid").jqGrid({</p>
<p>&#160;&#160; &#160; &#160; &#160;url:&#39;&#60;?php $html-&#62;url(&#39;/controller/action/param&#39;); ?&#62;,</p>
<p>&#160;&#160; &#160; &#160; &#160;mtype:&#39;GET&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160;datatype:&#39;xml&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160;caption:&#39;This grid blah blah blah&#8230;&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160;pager:&#39;#pagered&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160;sortname:&#39;leanob&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160;viewrecords:true,</p>
<p>&#160;&#160; &#160; &#160; &#160;multiselect:false,</p>
<p>&#160;&#160; &#160; &#160; &#160;autowidth: true,</p>
<p>&#160;&#160; &#160; &#160; &#160;height:400,</p>
</p>
<p>&#160;&#160; &#160; &#160; &#160;colNames:[</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;&#39;Action&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;...</p>
<p>&#160;&#160; &#160; &#160; &#160; ]</p>
</p>
<p>&#160;&#160; &#160; &#160; &#160; colModel:[</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;{name:&#39;act&#39;,index:&#39;act&#39;,width:60:sortable:false,editable:false},</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;...</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;]</p>
</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;gridComplete: function(){</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var ids = jQuery("#mygrid").jqGrid(&#39;getDataIDs&#39;);</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;for(var i = 0, i &#60; ids.length; i++){</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var cl = ids[i];</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;be = "&#60;input style=&#39;height:22px:width:40px;&#39; type=&#39;button&#39; value=&#39;Approve&#39; onclick="jQuery(&#39;#mygrid&#39;).editRow(&#39;"+cl+"&#39;);" &#160;/&#62;";</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;jQuery("#mygrid").jqGrid(&#39;setRowData&#39;,ids[i],{act:be});</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160;}</p>
</p>
<p>&#160;&#160; &#160;&#8230;</p>
</p>
<p>&#160;&#160; &#160;});</p>
<p>});</p>
]]></description>
        	        	<pubDate>Wed, 14 Apr 2010 00:31:21 +0300</pubDate>
        </item>
</channel>
</rss>