<?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: How does one align a single row to the top in JQGrid?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-does-one-align-a-single-row-to-the-top-in-jqgrid</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/how-does-one-align-a-single-row-to-the-top-in-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>m4bwav on How does one align a single row to the top in JQGrid?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-does-one-align-a-single-row-to-the-top-in-jqgrid#p21795</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-does-one-align-a-single-row-to-the-top-in-jqgrid#p21795</guid>
        	        	<description><![CDATA[<p>This alignment problem was solved by removing &#39;style="height: 300px"&#39; from the table element that is used by jqgrid.</p>
]]></description>
        	        	<pubDate>Sun, 23 Jan 2011 01:06:07 +0200</pubDate>
        </item>
        <item>
        	<title>m4bwav on How does one align a single row to the top in JQGrid?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-does-one-align-a-single-row-to-the-top-in-jqgrid#p21794</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-does-one-align-a-single-row-to-the-top-in-jqgrid#p21794</guid>
        	        	<description><![CDATA[<p>I first asked this question on <a title="Stack overflow question" href="http://stackoverflow.com/q/4763864/25847" target="_blank">StackOverflow here</a>.</p>
</p>
<p><strong>JQGrid</strong> is awesome for displaying data with <strong>jQuery</strong>, but it doesn&#39;t exactly have great documentation.</p>
<p>I&#39;m having a problem with the grid when the grid has only one element  to display.  For some reason, it&#39;s aligning the single row to the  bottom rather than to the top.</p>
</p>
<p>Here&#39;s a picture of a <strong>single misaligned row</strong>:</p>
<p><a href="http://i.imgur.com/xSwfW.png"><img src="http://i.imgur.com/xSwfW.png" width="100"  class="sfimageleft spUserImage" alt="A single misaligned row" /><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>Here are the jqgrid <strong>options</strong> I&#39;m passing in:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit5860' value='Select Code' data-codeid='sfcode5860' /></p><div class='sfcode' id='sfcode5860'>jQGridOptions = {<br />&#160; &#160; &#160; &#160; &#160; &#160; "recordtext": &#39;{0} - {1} of {2}&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; "url": &#39;data.json&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;datatype&#39;: &#39;json&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;mtype&#39;: &#39;GET&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;colModel&#39;: [<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; { &#39;name&#39;: &#39;Rank&#39;, &#39;align&#39;: &#39;center&#39;, &#39;index&#39;: &#39;Rank&#39;, &#39;sortable&#39;: false, &#39;search&#39;: false },<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; { &#39;name&#39;: &#39;Name&#39;, &#39;index&#39;: &#39;Name&#39;, &#39;sortable&#39;: false, &#39;search&#39;: true },<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; { &#39;name&#39;: &#39;Score&#39;, &#39;index&#39;: &#39;Score&#39;, &#39;sortable&#39;: false, &#39;search&#39;: false }<br />&#160; &#160; &#160; &#160; &#160; &#160; ],<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;pager&#39;: &#39;#ranking-pager&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;rowNum&#39;: rowsPerPage,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;altRows&#39;: true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;scrollOffset&#39;: 0,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;colNames&#39;: ["Rank", "Name", "Score"],<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;width&#39;: 696,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;height&#39;: &#39;auto&#39;, // &#39;100%&#39;, &#160;// 300,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;page&#39;: 1,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;sortname&#39;: &#39;Rank&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;sortorder&#39;: "asc",<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;hoverrows&#39;: true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;viewrecords&#39;: true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;gridComplete&#39;: function () {<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $(&#39;.ui-jqgrid-bdiv&#39;).jScrollPane({ showArrows: true, scrollbarWidth: 17, arrowSize: 17, scrollbarMargin: 0 });<br /><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; if (selectedRank !== -1) {<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; selectRank(selectedRank);<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; selectedRank = -1;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }<br />&#160; &#160; &#160; &#160; &#160; &#160; }<br />&#160; &#160; &#160; &#160; &#160; &#160; &#39;jsonReader&#39;: {<br />&#160; &#160; &#160; &#160; &#160; &#160;    &#39;repeatitems&#39;: false,<br />               id : &#39;Rank&#39;<br />&#160; &#160; &#160; &#160; }<br />&#160; &#160; };<br /></div></pre>
<p>As requested, here&#39;s the result from <strong>data.json</strong>:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit7577' value='Select Code' data-codeid='sfcode7577' /></p><div class='sfcode' id='sfcode7577'>{<br />&#160; &#160; "page":1,<br />&#160; &#160; "total":1,<br />&#160; &#160; "records":1,<br />&#160; &#160; "rows": &#160;[{<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; "Name":"Gil Agostini",<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; "Score":94,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; "Rank":1<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160;}]<br />}<br /></div></pre>
<p><strong>Call to jQGrid</strong>:</p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit6836' value='Select Code' data-codeid='sfcode6836' /></p><div class='sfcode' id='sfcode6836'>$(document).ready(function () {<br />&#160; &#160; &#160; &#160; $("#ranking-table").jqGrid(jQGridOptions);<br />});<br /></div></pre>
<p><strong>Html:</strong></p>
<pre class="default prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit2498' value='Select Code' data-codeid='sfcode2498' /></p><div class='sfcode' id='sfcode2498'>&#160;&#60;div style="float: left;"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-border1"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-border2"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-top-left hvy-corner"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-top-right hvy-corner"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="clear"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div id="table-and-pager" style="margin: 3px;"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;table id="ranking-table" class="scroll" cellpadding="0" cellspacing="0" style="height: 300px"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/table&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div id="ranking-pager" class="scroll" style="text-align: center;"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="clear"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-bottom-left hvy-corner"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div class="hvy-bottom-right hvy-corner"&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;!-- --&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#60;/div&#62;<br /></div></pre>
<p>Can anyone give me any clue what I maybe doing wrong here?</p>
<p>How do I get the row to align to the top rather than the bottom?</p>
]]></description>
        	        	<pubDate>Sun, 23 Jan 2011 00:08:53 +0200</pubDate>
        </item>
</channel>
</rss>