<?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: jQuery.css returns a string</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string</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/jquerycss-returns-a-string/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on jQuery.css returns a string</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8850</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8850</guid>
        	        	<description><![CDATA[<p>Hello Mark,</p>
<p>Thanks for this. I do not know about this bug. Will try to set the css at end of the expressions, where possible, but I think that this will be fixed in the next release of jQuery.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 21 Aug 2009 01:35:54 +0300</pubDate>
        </item>
        <item>
        	<title>markw65 on jQuery.css returns a string</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8821</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8821</guid>
        	        	<description><![CDATA[<p>Sorry, you&#39;re right... except that there appears to be a minor bug in jQuery.</p>
</p>
<p>If you&#39;re setting height or width, and you pass in a -ve value, (eg $("#foo").css("width", "-4px"), then it goes through the "undefined" case in the above, which then /returns/ the width, rather than setting the width, and returning a jQuery.</p>
</p>
<p>That&#39;s what was happening, and I just jumped to the conclusion that css always returned a string.</p>
</p>
<p>So now I need to track down how colModel[i].width gets to be &#60; 0. I think it has something to do with autowidth.</p>
</p>
<p>In any case, its probably my bug (in that it doesnt show up in firefox) - but I&#39;d still say that its a good idea not to chain the css method when setting width/height by name unless you&#39;re certain the width/height is &#62;= 0.</p>
</p>
<p>Mark</p></p>
]]></description>
        	        	<pubDate>Wed, 19 Aug 2009 15:30:04 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jQuery.css returns a string</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8816</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8816</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry, but I think that this is not true.</p>
<p>Here is the jQuery css:</p>
<p>&#160;&#160;&#160; css: function( key, value ) {<br />&#160;&#160;&#160; &#160;&#160;&#160; // ignore negative width and height values<br />&#160;&#160;&#160; &#160;&#160;&#160; if ( (key == &#39;width&#39; &#124;&#124; key == &#39;height&#39;) &#38;&#38; parseFloat(value) &#60; 0 )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value = undefined;<br />&#160;&#160;&#160; &#160;&#160;&#160; return this.attr( key, value, "curCSS" );<br />&#160;&#160;&#160; },</p>
<p>And here the attr</p>
<p>&#160;&#160;&#160; attr: function( name, value, type ) {<br />&#160;&#160;&#160; &#160;&#160;&#160; var options = name;</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; // Look for the case where we&#39;re accessing a style value<br />&#160;&#160;&#160; &#160;&#160;&#160; if ( typeof name === "string" )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if ( value === undefined )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return this[0] &#38;&#38; jQuery[ type &#124;&#124; "attr" ]( this[0], name );</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; options = {};<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; options[ name ] = value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; // Check to see if we&#39;re setting style values<br />&#160;&#160;&#160; &#160;&#160;&#160; return this.each(function(i){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Set all the styles<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; for ( name in options )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery.attr(<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; type ?<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; this.style :<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; this,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; name, jQuery.prop( this, options[ name ], type, i, name )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; );<br />&#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; },</p>
<p>So if we set value the css return this.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 19 Aug 2009 11:55:32 +0300</pubDate>
        </item>
        <item>
        	<title>markw65 on jQuery.css returns a string</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8812</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/jquerycss-returns-a-string#p8812</guid>
        	        	<description><![CDATA[<p>There are a few cases where the result of jQuery.css is being used as if it were of type jQuery. IE8 (and probably others) doesnt like that:</p>
</p>
<p>grid.base.js:1086</p>
<div id="LC1086" class="line"><span class="nx">$</span><span class="p">(</span><span class="nx">eg</span><span class="p">).</span><span class="nx">css</span><span class="p">(</span><span class="s2">"width"</span><span class="o">,</span><span class="nx">grid</span><span class="p">.</span><span class="nx">width</span><span class="o">+</span><span class="s2">"px"</span><span class="p">).</span><span class="nx">append</span><span class="p">(</span><span class="s2">"&#60;div class=&#39;ui-jqgrid-resize-mark&#39; id=&#39;rs_m"</span><span class="o">+</span><span class="nx">ts</span><span class="p">.</span><span class="nx">p</span><span class="p">.</span><span class="nx">id</span><span class="o">+</span><span class="s2">"&#39;&#62;&#38;nbsp;&#60;/div&#62;"</span><span class="p">);</span></div>
<div class="line"></div>
<div class="line">similarly line 1106.</div>
<div class="line"></div>
<div class="line">Mark</div>
<div class="line"></div>
]]></description>
        	        	<pubDate>Wed, 19 Aug 2009 11:08:22 +0300</pubDate>
        </item>
</channel>
</rss>