<?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: Small suggestions from JSLint</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-suggestions-from-jslint</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/small-suggestions-from-jslint/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on Small suggestions from JSLint</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/small-suggestions-from-jslint#p21197</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/small-suggestions-from-jslint#p21197</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>You made last time many changes in the code and I&#160;decide&#160;that it can be useful to verify the code with respect of <a href="http://www.jslint.com/" target="_blank">JSLint</a>. I used current code from the <a href="https://github.com/tonytomov/jqGrid" target="_blank">github</a>.</p>
<p>Here are the summary of the corresponding suggestions:</p>
<p>In the file of <strong>grid.common.js</strong>. Lines <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.common.js#L100" target="_blank">100-104</a></p>
<p><input type='button' class='sfcodeselect' name='sfselectit5271' value='Select Code' data-codeid='sfcode5271' /></p>
<div class='sfcode' id='sfcode5271'>var parentZ = $(insertSelector).parents(&#34;*[role=dialog]&#34;).first().css(&#34;z-index&#34;)<br /> if(parentZ)<br /> &#160;&#160;&#160; p.zIndex = parseInt(parentZ)+1<br /> else<br /> &#160;&#160;&#160; p.zIndex = 950;</div>
<p>Should be modified to the following</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3953' value='Select Code' data-codeid='sfcode3953' /></p>
<div class='sfcode' id='sfcode3953'>var parentZ = $(insertSelector).parents(&#34;*[role=dialog]&#34;).first().css(&#34;z-index&#34;)<strong>;</strong><br /> if(parentZ)<strong> {</strong><br /> &#160;&#160;&#160; p.zIndex = parseInt(parentZ)+1<strong>;</strong><br /> <strong>} </strong>else <strong>{</strong><br /> &#160;&#160;&#160; p.zIndex = 950;<br /> <strong>}</strong></div>
<p>(semicolon at the end of the first an the third lines and two {} blocks)</p>
<p>In the file <strong>grid.formedit.js</strong> the variable <strong>copydata</strong> defined in the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L353" target="_blank">353</a> will be never used. The variable with the same name are defined in the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L625" target="_blank">625</a> will be used only. In the same way variable <strong>opt</strong> defined in the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L1186" target="_blank">1186</a> will be also never used. Probably in some lines after the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L1186" target="_blank">1186</a> instead of <strong>opt</strong> variable&#160;are used&#160;another variable.</p>
<p>At the end the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1357" target="_blank">1357</a> of the file <strong>grid.base.js</strong> are missing semicolon(;)</p>
<p>In the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1718" target="_blank">1718</a> and <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1731" target="_blank">1731</a> are used empty blocks. One can eliminate the code in a simple way.</p>
<p>In the file <strong>grid.setcolumns.j</strong>s in the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.setcolumns.js#L54" target="_blank">54</a> are missed <strong>var</strong> vor i. Currently i will be <strong><span style="text-decoration: underline;">global</span></strong>.</p>
<p>In the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.setcolumns.js#L60" target="_blank">60</a> are missing semicolon.</p>
<p>In the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.setcolumns.js#L91" target="_blank">91</a> the statement after the if(p.closeAfterSubmit) should be enclosed in block {}.</p>
<p>In the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.treegrid.js#L31" target="_blank">31-33</a> of the file <strong>grid.treegrid.js</strong> are used empfy block which could be better removed. In the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.treegrid.js#L45" target="_blank">45</a> if(rd[loaded] != undefined) should be better replaced with if(rd[loaded] !== undefined) or if(typedef(rd[loaded]) !== &#39;undefined&#39;)</p>
<p>In the lines <a href="https://github.com/tonytomov/jqGrid/blob/master/js/jquery.fmatter.js#L398" target="_blank">398</a> and <a href="https://github.com/tonytomov/jqGrid/blob/master/js/jquery.fmatter.js#L403" target="_blank">403</a> of the file <strong>jquery.fmatter.js</strong> the statement after &#39;if&#39; should be placed in the block {}</p>
<p>In the file JsonXml.js one should in the lines <a href="https://github.com/tonytomov/jqGrid/blob/master/js/JsonXml.js#L61" target="_blank">61</a>, <a href="https://github.com/tonytomov/jqGrid/blob/master/js/JsonXml.js#L71" target="_blank">71</a>, <a href="https://github.com/tonytomov/jqGrid/blob/master/js/JsonXml.js#L100" target="_blank">100</a>, <a href="https://github.com/tonytomov/jqGrid/blob/master/js/JsonXml.js#L239" target="_blank">239</a>.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 07 Dec 2010 13:35:28 +0200</pubDate>
        </item>
</channel>
</rss>