<?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: removing special characters from ids</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids</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/removing-special-characters-from-ids/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on removing special characters from ids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22698</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22698</guid>
        	        	<description><![CDATA[<p>You are right Tony,</p>
<p>one can not use the line<strong></strong></p>
<p><input type='button' class='sfcodeselect' name='sfselectit6385' value='Select Code' data-codeid='sfcode6385' /></p>
<div class='sfcode' id='sfcode6385'><strong>ts.p.colModel[i].name = $.jgrid.jqID(ts.p.colModel[i].name);</strong></div>
<p>Probably one should only replace <strong>ts.p.colModel[i].name</strong> to <strong>$.jgrid.jqID(ts.p.colModel[i].name)</strong>&#160;in the lines <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L2039" target="_blank">2039</a> and <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L2041" target="_blank">2041</a> of <em>grid.base.js</em>.</p>
<p>The removing of characters, which are not permitted in id (like blanks), from the string which returns <strong>$.jgrid.jqID()</strong>&#160;seems me desirable&#160;regardless of all other things.</p>
<p>Best regrads<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Thu, 07 Apr 2011 12:35:14 +0300</pubDate>
        </item>
        <item>
        	<title>tony on removing special characters from ids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22697</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22697</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>I&#39;m not sure that this fix is the appropriate.</p>
<p>Imagrine the field contain . (dot) after this fix and after query the name we will have escaped name - i.e not correct.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 07 Apr 2011 11:37:40 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on removing special characters from ids</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22693</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/removing-special-characters-from-ids#p22693</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>One common problem of newcomers is the usage of special characters like spaces (blanks) in the places which will be used as ids or to construct ids: the <strong>name</strong> property of <strong>colName</strong>s or <strong>id</strong>s of the rows. The <strong>name</strong> property will be used for example to build ids of the <strong>&#60;th&#62;</strong> elements of the table (see line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L2039" target="_blank">2039</a> of <em>grid.base.js</em>).</p>
<p>I suggest:</p>
<p>1) to include a the and of for loop at the line <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1955" target="_blank">1955</a>&#160;some additional lines:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit221' value='Select Code' data-codeid='sfcode221' /></p>
<div class='sfcode' id='sfcode221'>for (i=0; i&#60;ts.p.colModel.length;i++) {<br />&#160;&#160; &#160;ts.p.colModel[i] = $.extend(true, {}, ts.p.cmTemplate, ts.p.colModel[i].template &#124;&#124; {}, ts.p.colModel[i]);<br />&#160;&#160; &#160;if (ts.p.keyIndex === false &#38;&#38; ts.p.colModel[i].key===true) {<br />&#160;&#160; &#160; &#160; &#160;ts.p.keyIndex = i;<br />&#160;&#160; &#160;}<br />&#160;&#160; &#160;<strong>if(typeof(ts.p.colModel[i].index)) === &#34;undefined&#34;) {<br />&#160;&#160; &#160; &#160; &#160;typeof(ts.p.colModel[i].index = ts.p.colModel[i].name;<br />&#160;&#160; &#160;}<br />&#160;&#160; &#160;ts.p.colModel[i].name = $.jgrid.jqID(ts.p.colModel[i].name);</strong><br />}&#160;</div>
<p>The code will allows to use special charactres (like &#39;id asc, name asc&#39;) in the index, but not in the names.</p>
<p>2) Expand the code of <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L120" target="_blank">jqID</a> to remove all characters which not corresponds to the <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier" target="_blank">W3C CSS specification</a>&#160;at least space characters as the most common problem.</p>
<p>Best regards<br />Oleg&#160;</p></p>
]]></description>
        	        	<pubDate>Wed, 06 Apr 2011 20:16:52 +0300</pubDate>
        </item>
</channel>
</rss>