<?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: Getting column headers to line up with the column data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data</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/getting-column-headers-to-line-up-with-the-column-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>smetatag on Getting column headers to line up with the column data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20245</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20245</guid>
        	        	<description><![CDATA[<p>The problem seems to appear in Firefox ony, in Chrome it is OK. The calculated widths do match</p>
<p>but firefox renders it wrong?!</p>
</p>
<p>Edit:</p>
<p>solved</p>
<p>th {</p>
<pre>   -moz-box-sizing:    border-box;
   -webkit-box-sizing: border-box;
    box-sizing:        border-box;<br />}</pre>
]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 14:38:45 +0300</pubDate>
        </item>
        <item>
        	<title>jackkitley on Getting column headers to line up with the column data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20146</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20146</guid>
        	        	<description><![CDATA[<p>Howdy,</p>
</p>
<p>This is some of my code that i have done in the past. The column headers match with the relevant data, it has a horizontal scrollbar too.</p>
<p>&#160;&#160;&#160; jQuery(document).ready(function(){ <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; jQuery("#list").jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;url:&#39;/clubs/event_contacts_view_data&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;datatype: &#39;json&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;mtype: &#39;POST&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colNames:[<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;Actions&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;Profile&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;company_name&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;first_name&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;last_name&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;entry_date&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;email&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;phone_work&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;phone_home&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;phone_mobile&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;fax&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;source_name&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#39;&#60;?= $lang-&#62;tr(&#39;allocated_to&#39;, $session-&#62;read(&#39;language&#39;)) ?&#62;&#39;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;colModel :[<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;Actions&#39;, index:&#39;Actions&#39;,search:false,sortable:false, width:75},&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;Profile&#39;, index:&#39;Profile&#39;,search:false,sortable:false, width:70}, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;company_name&#39;, index:&#39;company_name&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;first_name&#39;, index:&#39;first_name&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;u.last_name&#39;, index:&#39;u.last_name&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;entry_date&#39;, index:&#39;entry_date&#39;, width:150},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;email&#39;, index:&#39;email&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;phone_work&#39;, index:&#39;phone_work&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;phone_home&#39;, index:&#39;phone_home&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;phone_mobile&#39;, index:&#39;phone_mobile&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;fax&#39;, index:&#39;fax&#39;, width:200},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;source_name&#39;, index:&#39;source_name&#39;, width:150},&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;allocated_to&#39;, index:&#39;allocated_to&#39;, width:150}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;],<br />&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;stateOptions: {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; storageKey: "LeadsCookie",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; columns: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; filters: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; selection: false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; pager: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; order: true<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;},&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;rowNum:&#60;?= isset($_SESSION["jqlimit"])?$_SESSION["jqlimit"]:10?&#62;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;rowList:[10,20,50,100],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortname: &#39;u.last_name&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortorder: &#39;ASC&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;multiselect: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;viewrecords: true,&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;caption: &#39;Leads&#39;,&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;height:&#39;auto&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;shrinkToFit:false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;loadComplete: function(){ <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; setTimeout(function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; $("#list").setGridWidth($("#flexicontent").width());<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; $(".ui-jqgrid-bdiv").css("overflow","auto");&#160;&#160; &#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; &#160;&#160; },100);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; },&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;loadError : function(xhr,st,err) { jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText); }&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#list").jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{del:false,add:false,edit:false,search:false}); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$("#list").jqGrid(&#39;filterToolbar&#39;,{stringResult: true,searchOnEnter : false}); &#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $(window).bind(&#39;resize&#39;, function() {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $("#list").setGridWidth($("#flexicontent").width());<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $(".ui-jqgrid-bdiv").css("overflow","auto");&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; }).trigger(&#39;resize&#39;);&#160;&#160;&#160;</p>
</p>
<p>Ignore stateoptions value. If u want the grid to fit in 100% with no scroll then set $(".ui-jqgrid-bdiv").css("overflow","none"); , also set&#160; shrinkToFit:true,</p>
<p>oh, $("#list").setGridWidth($("#flexicontent").width()); ---- flexicontent is a div surrounding the whole thing set to a percentage, when u resize ur screen the grid will move too.</p>
<p>Hope you solve it</p>
]]></description>
        	        	<pubDate>Tue, 05 Oct 2010 13:35:29 +0300</pubDate>
        </item>
        <item>
        	<title>Chad LaVigne on Getting column headers to line up with the column data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20135</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20135</guid>
        	        	<description><![CDATA[</p>
<p>I also encountered this issue.&#160; It appears to be a bug with the shrinkToFit option not sizing the column headers</p>
<p>correctly (you can even see it on the jQuery grid demos).&#160; It looks like perhaps the table header widths aren&#39;t</p>
<p>accounting for the left 1px border when setting the width on the &#60;th&#62; tags so the column headers get</p>
<p>progressively off by 1px.&#160; Rather than hack the jQuery grid code I just made a temporary fix until the</p>
<p>jQuery grid team can fix the issue.&#160; Here&#39;s the temporary fix I&#39;m using:</p>
<blockquote>
<p>function gridColumnWidthCorrection(gridId) {&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;$(&#39;#gview_&#39; + gridId + &#39; .ui-jqgrid-labels th&#39;).each(function(i) {<br />&#160;&#160; &#160;&#160;&#160; &#160;if($(this).css(&#39;display&#39;) != &#39;none&#39;) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var widthString = $(this).css(&#39;width&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var width = eval(widthString.substr(0, widthString.indexOf(&#39;px&#39;)));<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(this).css(&#39;width&#39;, (width &#8211; 1) + &#39;px&#39;);&#160;&#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;<br />&#160;&#160; &#160;});&#160;&#160; &#160;&#160;&#160; &#160;<br />}</p>
</blockquote>
<p>If anyone has a better solution using options in jQuery grid or thinks I&#39;ve misdiagnosed the problem</p>
<p>please let me know.</p>
<p> Chad</p>
]]></description>
        	        	<pubDate>Mon, 04 Oct 2010 23:47:52 +0300</pubDate>
        </item>
        <item>
        	<title>bwiegert on Getting column headers to line up with the column data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20071</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/getting-column-headers-to-line-up-with-the-column-data#p20071</guid>
        	        	<description><![CDATA[<p>I am trying to make the headers line up with the column body in the grid and can not.</p>
<p>I am specifying the column width in the colModel, and specifying a width property in the grid definition. &#160;</p>
<p>I have tried shrinkToFit to be true and false. &#160;Nothing seems to work. &#160;</p>
<p>When I don&#39;t specify the widths then everything lines up, but my columns</p>
<p>aren&#39;t the right size and don&#39;t show enough data. &#160;Any idea what I am doing wrong? &#160;</p>
<p>Here is my grid definition:</p>
</p>
<pre>var namesTableGridOptions = {
	url: &#39;${pageContext.request.contextPath}/orderentryajax/getNamelist.do?searchFilter=&#39; + $(&#39;#searchText&#39;).val(),
	datatype: &#39;json&#39;,
	mtype: &#39;GET&#39;, 	
	jsonReader : {repeatitems: false}, 		
	height: 300,				
	width: 800, 
	shrinkToFit: false,
	rowNum: -1,							
	colNames:[&#39;Last Name&#39;, &#39;First and Middle Name&#39;, &#39;Address 1&#39;, &#39;Address 2&#39;, &#39;City&#39;, &#39;State&#39;, &#39;Zip&#39;, &#39;Guid&#39;],   					 
	colModel:[
		{name:&#39;lastName&#39;, width: &#39;125&#39;, sortable: true},
		{name:&#39;firstName&#39;, hidden: false, width: &#39;175&#39; , sortable: true},
		{name:&#39;address1&#39;, hidden: false, width: &#39;170&#39;, sortable: true},
		{name:&#39;address2&#39;, sortable: true, width: &#39;90&#39;},  
		{name:&#39;city&#39;, sortable: true, width: &#39;100&#39;},  
		{name:&#39;state&#39;, sortable: true, width: &#39;65&#39;},
		{name:&#39;postalCode&#39;, width: &#39;75&#39;, sortable: true},
		{name:&#39;namelistGuid&#39;, hidden: true}
		], 
	viewrecords: true,
	altRows: true,
	altclass: &#39;ui-jqgrid-alt-row&#39;,
	loadonce: true
};

$(&#39;#namesTable&#39;).jqGrid(namesTableGridOptions);
</pre>
]]></description>
        	        	<pubDate>Wed, 29 Sep 2010 20:25:09 +0300</pubDate>
        </item>
</channel>
</rss>