<?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: sorting breaks altclass</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/sorting-breaks-altclass</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/sorting-breaks-altclass/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jkaufman on sorting breaks altclass</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/sorting-breaks-altclass#p22742</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/sorting-breaks-altclass#p22742</guid>
        	        	<description><![CDATA[<p>Not a new topic, but I just can&#39;t figure out how to make jqGrid get the  alternate row backgrounds right after sorting. I am loading the grid  fine with correct alternate rows using altRow:true and  altclass:&#39;myAltClass&#39; however when I sort the class is wrong. If I  remove the altRow and altclass and try to fiddle with values in  loadComplete or gridComplete I get weird results. Any ideas would be  very much appreciated. Cheers</p>
<p>Hello,</p>
<p>Please post what are all your grid options?</p>
<p>i.e $grid-&#62;setGridOptions(....)</p>
<p>Do you use datatype=local?</p>
<p>Also in the future please post your code, this will save our and your time.</p>
<p>Kind Regards</p>
<p>jQuery("#gwidth").jqGrid(<br /> {<br /> url:&#39;ajaxtest.php?terri=&#39;+terri+&#39;&#38;ruler=&#39;+ruler, <br /> datatype: "json", <br /> colNames:[&#39;name&#39;,&#39;id&#39;, &#39;industry&#39;], <br /> colModel:[ 	{name:&#39;id&#39;,index:&#39;id&#39;, width:155}, <br /> {name:&#39;name&#39;,index:&#39;name&#39;, width:100}, <br /> {name:&#39;industry&#39;,index:&#39;industry&#39;, width:180,align:"left"}<br /> ], <br /> height:howhi,<br /> loadOnce:true,<br /> sortname: &#39;id&#39;,<br /> sortable: true,<br /> rowNum:100000, <br /> scrollOffset: 25,<br /> autowidth:true,<br /> shrinkToFit:false,<br /> altRows:true,<br /> altclass:"myAltRowClass",</p>
<p> //loadComplete : function () {<br /> // jQuery("#gridid").jqGrid(&#39;setGridParam&#39;,{datatype:&#39;local&#39;});<br /> //applyZebra(&#39;gwidth&#39;);<br /> //},</p>
<p> onSortCol: function(index, iCol, sortorder) {<br /> $("#gwidth").setGridParam({ datatype: &#39;local&#39; });<br /> //$("tr.#gwidth:odd").addClass(&#39;myAltRowClass&#39;);<br /> // applyZebra(&#39;gwidth&#39;);<br /> },<br /> gridview: true,<br /> gridComplete: function() {</p>
<p> // applyZebra(&#39;gwidth&#39;);</p>
<p> }<br /> //	forceFit : true <br /> }<br />);</p>
<p>Hello,<br />It seems you use the open source version, but instead I will check it.</p>
<p>In your code you have</p>
<p>loadOnce:true,<br />this is bad - it should be:</p>
<p>loadonce :  true</p>
<p>which mean you do not post your original code.<br />How look your myAltRowClass.</p>
<p>Please post your problem here:<br /><a title="http://www.trirand.com/blog" rel="nofollow" href="/blog" target="_blank"></a><a href="http://www.trirand.com/blog" rel="nofollow" target="_blank">http://www.trirand.com/blog</a> </p>
<p>Kind Regards<br />Tony</p>
</p>
<p>Hello Tony, I sent the actual/origianl code. I also changed the loadOnce:true but it made no difference in what I was seeing.</p>
<p>Is there a way to do this so that the zebra stripes respect the fact that the grid has been sorted? thanks!</p>
]]></description>
        	        	<pubDate>Mon, 11 Apr 2011 21:51:30 +0300</pubDate>
        </item>
</channel>
</rss>