<?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: setSelection case insensitive</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive</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/setselection-case-insensitive/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Hdogger on setSelection case insensitive</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p30020</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p30020</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
</p>
<p>Instead I will replace the namedItem function. It causes a problems in iOS7 (which i think is a bug in the Safari)</p>
</p>
<p>Regards</p>
</p>
</blockquote>
<hr />
<p>I had the same problem in IOS 7 with jqGrid. Here is how I solved it. I added this function to the top of jquery.jqGrid.src.js</p>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit4326' value='Select Code' data-codeid='sfcode4326' /></p><div class='sfcode' id='sfcode4326'>function CorrectNamedItem(collection, name) {
    var result = null;
    $.each(collection, function (index, elem) {
        if (elem.id === name &#124;&#124; elem.name === name) {
            result = elem;
            return false;
        }
    });

    return result;
}
</div></pre>
<pre><p><input type='button' class='sfcodeselect' name='sfselectit1738' value='Select Code' data-codeid='sfcode1738' /></p><div class='sfcode' id='sfcode1738'><br /></div></pre>
<p>Then whenever jqGrid has a call like this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9216' value='Select Code' data-codeid='sfcode9216' /></p>
<div class='sfcode' id='sfcode9216'>var ind = ts.rows.namedItem(n);</div>
</p>
<p>I changed it into a call like this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2555' value='Select Code' data-codeid='sfcode2555' /></p>
<div class='sfcode' id='sfcode2555'>var ind = CorrectNamedItem(ts.rows, n);</div>
</p>
<p>Now IOS 7 jqGrid works fine.</p>
<p>I hope this change can be made into jqGrid permanently, since IOS 7 has poor behavior of the inbuilt function namedItem.</p>
]]></description>
        	        	<pubDate>Fri, 20 Dec 2013 19:46:00 +0200</pubDate>
        </item>
        <item>
        	<title>tony on setSelection case insensitive</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29620</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29620</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Instead I will replace the namedItem function. It causes a problems in iOS7 (which i think is a bug in the Safari)</p>
</p>
<p>Regards</p></p>
]]></description>
        	        	<pubDate>Sun, 06 Oct 2013 12:58:44 +0300</pubDate>
        </item>
        <item>
        	<title>DigitalForster on setSelection case insensitive</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29502</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29502</guid>
        	        	<description><![CDATA[<p>Hi Oleg,</p>
</p>
<p>Ok, I will adapt my code.</p>
</p>
<p>Thks for the help,</p>
</p>
<p>Regards</p>
<p>DigitalFoster <img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" /></p>
]]></description>
        	        	<pubDate>Thu, 19 Sep 2013 15:59:47 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on setSelection case insensitive</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29500</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29500</guid>
        	        	<description><![CDATA[<p>Hi DigitalForster,</p>
<p>I suppose that you use Internet Explorer. It&#39;s remind me about <a href="http://stackoverflow.com/a/7236985/315935" target="_blank">the old answer</a>. I made an official support request to Microsoft and Microsoft confirmed that <strong>rows.namedItem</strong>&#160;works incorrect with the case of ids. In one uses <strong>getElementById</strong>&#160;with id then it works correctly with the case of id in Internet Explorer.</p>
<p>The problem <em>why</em> it&#39;s difficult to use <strong></strong><strong>getElementById</strong>&#160;instead of <strong>rows.namedItem</strong>&#160;consist in misunderstanding of <em>uniques</em> of ids (rowids) by many users. <em>Id must be unique over the whole HTML page</em>. The problem is that many developers who uses jqGrid don&#39;t understand that. Some developers don&#39;t provide any id value at all. jqGrid have <strong>$.jgrid.randId()</strong> function, but it don&#39;t uses it during generating of rowids in case of undefined ids in the input. Instead of that it uses values 1,2,3&#8230; to be compatible with old versions of jqGrid. Another possible problem is in usage of more as one grids on the page. Even if the rowids are unique because there come from ids of one database table one can have still conflicts if one would use the same ids for more as one grid on the page. In the case one have to use <strong>idPrefix</strong> option for at least one grid, but not every edvelopers uses it. So jqGrid have to have code which should work event if rowids are unique inside of one grid only, but could be non-unique on the page. The method <strong>rows.namedItem</strong>&#160;helps here. Only the bug in Internet Explorer makes difficult to use ids which are not unique in&#160;case insensitive comparing.</p>
<p>As a workaround I recommend you to use <em>another</em> ids as which you use currently. I understand that it sounds hard, but it&#39;s clear that you have not the best choice of id currently. What I mean is just providing case insensitive ids for jqGrid and not changing of your backend. One can imagine many one-to-one conversions of original ids to the values which you can use in jqGrid. For example <a href="http://en.wikipedia.org/wiki/Base64" target="_blank">base64</a> coversion can be used.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Thu, 19 Sep 2013 14:30:24 +0300</pubDate>
        </item>
        <item>
        	<title>DigitalForster on setSelection case insensitive</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29499</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/setselection-case-insensitive#p29499</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I&#39;m using a unique id made by a custom encoding that means I can have two different records with the same charater but one in lower case and the other lower case.</p>
<p>I saw in the setSelection method that you use $t.rows.namedItem(String(selection)); but this will return the first name that macth with case insensitive.</p>
<p>Why don&#39;t use jQuery selector [id=?] or getElementsByName and loop to compare&#160;id attribute&#160;with the selection variable ?</p>
<p>Could you let me now if you can build a quick fix ?</p>
</p>
<p>Thks</p></p>
]]></description>
        	        	<pubDate>Thu, 19 Sep 2013 13:49:46 +0300</pubDate>
        </item>
</channel>
</rss>