<?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: &#091;Bug&#093; definition of clearToolbar - v is not undefined, is not initialized.</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized</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/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on &#091;Bug&#093; definition of clearToolbar - v is not undefined, is not initialized.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized#p25660</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized#p25660</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>See here:</p>
<p><a href="https://github.com/tonytomov/jqGrid/commit/36ae4008fbf4d4d47d7993c28d523c5f356e4f20" rel="nofollow" target="_blank">https://github.com/tonytomov/jqGrid/commit/36ae4008fbf4d4d47d7993c28d523c5f356e4f20</a></p>
<p>Thanks.</p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Sat, 14 Jan 2012 01:06:16 +0200</pubDate>
        </item>
        <item>
        	<title>Scevra on &#091;Bug&#093; definition of clearToolbar - v is not undefined, is not initialized.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized#p25656</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-definition-of-cleartoolbar-v-is-not-undefined-is-not-initialized#p25656</guid>
        	        	<description><![CDATA[<p>Hi tony,</p>
<p>I saw the corrections you made, but I think I found another bug in the committed file <strong>js/grid.custom.js</strong> line 199-200:</p>
<pre><a href="https://github.com/tonytomov/jqGrid/commit/bd5ac35861c269ffa48f80dbdfd37d6d1be7dcb4#L0L199" rel="nofollow" target="_blank">https://github.com/tonytomov/jqGrid/commit/bd5ac35861c269ffa48f80dbdfd37d6d1be7dcb4#L0L199</a><br /><br />Into the <em>each</em> part, in the last version (updated in GitHub) you have removed this line:<br /></pre>
<pre></pre>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit2491' value='Select Code' data-codeid='sfcode2491' /></p><div class='sfcode' id='sfcode2491'>v&#160;=&#160;(this.searchoptions&#160;&#38;&#38;&#160;this.searchoptions.defaultValue)&#160;?&#160;this.searchoptions.defaultValue&#160;:&#160;&#34;&#34;;</div></pre>
<p>and you add only this line:</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit4105' value='Select Code' data-codeid='sfcode4105' /></p><div class='sfcode' id='sfcode4105'>&#160;if(this.searchoptions&#160;&#38;&#38;&#160;this.searchoptions.defaultValue&#160;!==&#160;undefined)&#160;{&#160;v&#160;=&#160;this.searchoptions.defaultValue;&#160;}</div></pre>
<p>But doing this, <strong>v</strong> is <em>undefined </em>the first time of the each (and all works well), but not in the future.<br /><strong>v</strong> can&#39;t be updated from the previous value if the <em>IF</em> condition fails (and that my case, in my application).<br />This is a problem, cause there are a lot of <strong>if ( v !== undefined )</strong> in the code after that line.</p>
<p>So I think <strong>v</strong> has to be initialized every time after the<strong><em> </em>$.each($t.p.colModel,function(i,n){</strong>.</p>
<p>I changed my code like this, and it works fine to me:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3012' value='Select Code' data-codeid='sfcode3012' /></p>
<div class='sfcode' id='sfcode3012'>var clearToolbar = function(trigger){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var sdata={}, v, j=0, nm;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;trigger = (typeof trigger != &#39;boolean&#39;) ? true : trigger;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$.each($t.p.colModel,function(i,n){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;<strong> <span style=&#34;color: #0000ff;&#34;>&#160;<em>v = undefined;</em></span></strong><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(this.searchoptions &#38;&#38; this.searchoptions.defaultValue !== undefined) { v = this.searchoptions.defaultValue; }<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;nm = this.index &#124;&#124; this.name;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;switch (this.stype) {</div>
<p>Is a bug, right?</p>
<p>Bye,<br />Scevra</p>
]]></description>
        	        	<pubDate>Fri, 13 Jan 2012 17:03:42 +0200</pubDate>
        </item>
</channel>
</rss>