<?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: usage of jQuery.parseXML and other jQuery functions</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/usage-of-jquery-parsexml-and-other-jquery-functions</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/discussion/usage-of-jquery-parsexml-and-other-jquery-functions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on usage of jQuery.parseXML and other jQuery functions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/usage-of-jquery-parsexml-and-other-jquery-functions#p28358</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/usage-of-jquery-parsexml-and-other-jquery-functions#p28358</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>You are absolutley right.</p>
<p>Will begin with this today.</p>
<p>Thanks.</p>
</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 01 Mar 2013 10:01:02 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on usage of jQuery.parseXML and other jQuery functions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/usage-of-jquery-parsexml-and-other-jquery-functions#p28345</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/usage-of-jquery-parsexml-and-other-jquery-functions#p28345</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>I suggest to reduce a little the size of jqGrid by usage standard jQuery functions. For example one can use jQuery.parseXML (see <a href="https://github.com/jquery/jquery/blob/1.9.1/src/core.js#L549-L570" target="_blank">the source code</a>) is very close to the code of <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/grid.base.js#L69-L82" target="_blank">stringToDoc</a>&#160;used by jqGrid. So it seems to me that one can replace <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/grid.base.js#L1871" target="_blank">the line</a>&#160;of <em>grid.base.js</em></p>
<p><input type='button' class='sfcodeselect' name='sfselectit491' value='Select Code' data-codeid='sfcode491' /></p>
<div class='sfcode' id='sfcode491'>dstr = $.jgrid.stringToDoc(ts.p.datastr);</div>
<p>to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6530' value='Select Code' data-codeid='sfcode6530' /></p>
<div class='sfcode' id='sfcode6530'>dstr = typeof ts.p.datastr&#160;!== &#39;string&#39; ? ts.p.datastr :&#160;$.parseXML(ts.p.datastr);</div>
<p>and another line of <em>grid.import.js</em></p>
<p><input type='button' class='sfcodeselect' name='sfselectit2843' value='Select Code' data-codeid='sfcode2843' /></p>
<div class='sfcode' id='sfcode2843'>var xmld = $.jgrid.stringToDoc(o.impstring);</div>
<p>to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5050' value='Select Code' data-codeid='sfcode5050' /></p>
<div class='sfcode' id='sfcode5050'>var xmld = $.parseXML(o.impstring);</div>
<p>One can examine additionally the requirements of usage <strong class="final-path">JsonXml.js</strong><span class="final-path">&#160;(at least the most parts of the code) and the usage of <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/grid.base.js#L83-L91" target="_blank">$.jgrid.parse</a>. It seems to me that one can remove all or some parts of the code and use standard methods which are now in jQuery.</span></p>
<p><span class="final-path">Additionally it would be good to place directly on the&#160;<a href="/blog/?page_id=6" target="_blank">jqGrid download page</a>&#160;and in&#160;<a href="/jqgridwiki/doku.php?id=wiki:system" target="_blank">the documentation</a>&#160;which versions (from, till) of jQuery are supported by which versions of jqGrid.</span></p>
<p><span class="final-path">It seems to me that one can also remove now some from the functions declared and used in the <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/jquery.fmatter.js" target="_blank">jquery.fmatter.js</a> module (for example <strong>$.fmatter.isNull</strong> which will be never used or <strong>$.fmatter.isUndefined</strong>). For exmaple <strong>$.fmatter</strong>.<strong>isUndefined</strong> will be used only inside of <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/jquery.fmatter.js" target="_blank">jquery.fmatter.js</a>&#160;module. The line like <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.4/js/jquery.fmatter.js#L269" target="_blank">this one</a>&#160;</span></p>
<p><input type='button' class='sfcodeselect' name='sfselectit3065' value='Select Code' data-codeid='sfcode3065' /></p>
<div class='sfcode' id='sfcode3065'>if(opts.colModel !== undefined &#38;&#38; !$.fmatter.isUndefined(opts.colModel.formatoptions)) {</div>
<p>can be safe replaced to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6133' value='Select Code' data-codeid='sfcode6133' /></p>
<div class='sfcode' id='sfcode6133'>if(opts.colModel !== undefined &#38;&#38; <strong>opts.colModel.formatoptions !== undefined</strong>) {</div>
<p>or</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1311' value='Select Code' data-codeid='sfcode1311' /></p>
<div class='sfcode' id='sfcode1311'>if(opts.colModel <strong>!= null</strong> &#38;&#38; opts.colModel.formatoptions <strong>!= null</strong>) { // test for null or undefind</div>
<p>All the changes which I suggest here are not really important, but I think that it&#39;s good to clean up code from time to time.</p>
<p><span class="final-path">Best regards<br />Oleg</span></p></p>
]]></description>
        	        	<pubDate>Thu, 28 Feb 2013 12:01:47 +0200</pubDate>
        </item>
</channel>
</rss>