<?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: Select control options automatically re-sorted when values are numeric.</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/select-control-options-automatically-re-sorted-when-values-are-numeric</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/select-control-options-automatically-re-sorted-when-values-are-numeric/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Inara on Select control options automatically re-sorted when values are numeric.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/select-control-options-automatically-re-sorted-when-values-are-numeric#p29195</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/select-control-options-automatically-re-sorted-when-values-are-numeric#p29195</guid>
        	        	<description><![CDATA[<p>A quick update on the issue: jqGrid doesn&#39;t re-sort the options if they are passed to editoptions as a string (i.e., in the example above, value:":;8:ACME Inc.;3:Basic, LLC;7:Large Corp;2:Simple Organization;4:Testing Organization").</p>
</p>
<p><strong>EDIT:</strong> Unfortunately, there is no way to escape colon characters when using the string method, so you can&#39;t use any options with a colon in them. Since the object notation is the only way to allow all characters, I would consider the sorting bug to be a major issue.</p>
</p>
<p><strong>EDIT 2:</strong> The bug with object sorting is apparently inherent to the javascript object implementation: <a href="http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order" target="_blank">Javascript Object Property Order</a>. Would it be possible to switch over to using a pair of arrays (one for keys, one for values) to support a non-string notation that still allows explicit sorting?</p>
</p>
<p><strong>EDIT 3: </strong>I just found out that there is undocumented support for custom "delimiter" and "separator" options for the string notation model. Is there a reason they&#39;re not included in the wiki documentation, or was that an oversight?</p>
]]></description>
        	        	<pubDate>Fri, 19 Jul 2013 23:55:34 +0300</pubDate>
        </item>
        <item>
        	<title>Inara on Select control options automatically re-sorted when values are numeric.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/select-control-options-automatically-re-sorted-when-values-are-numeric#p29018</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/select-control-options-automatically-re-sorted-when-values-are-numeric#p29018</guid>
        	        	<description><![CDATA[<p>I recently stumbled upon the following issue: For an editable grid (I tested both form edit and inline edit modes), if you pass a select control a value list with only numeric storage values, jqGrid automatically re-sorts the list by the storage values when it converts the values to a dropdown.</p>
</p>
<p>For example, if I include the following value list in the editoptions for a select column:</p>
<p>value:{"":"","8":"ACME Inc.","3":"Basic, LLC","7":"Large Corp","2":"Simple Organization","4":"Testing Organization"}</p>
<p> I expect to get the following select list: <br />&#60;option role="option" value=""&#62;&#60;/option&#62;<br />&#60;option role="option" value="8"&#62;ACME Inc.&#60;/option&#62;<br />&#60;option role="option" value="3"&#62;Basic, LLC&#60;/option&#62;<br />&#60;option role="option" value="7"&#62;Large Corp&#60;/option&#62;<br />&#60;option role="option" value="2"&#62;Simple Organization&#60;/option&#62;<br />&#60;option role="option" value="4"&#62;Testing Organization&#60;/option&#62;</p>
<p>Instead, I get this:<br />&#60;option role="option" value="2"&#62;Simple Organization&#60;/option&#62;<br />&#60;option role="option" value="3"&#62;Basic, LLC&#60;/option&#62;<br />&#60;option role="option" value="4"&#62;Testing Organization&#60;/option&#62;<br />&#60;option role="option" value="7"&#62;Large Corp&#60;/option&#62;<br />&#60;option role="option" value="8"&#62;ACME Inc.&#60;/option&#62;<br />&#60;option role="option" value=""&#62;&#60;/option&#62;</p>
<p>Is there any way to turn off this auto-sorting behavior? I would like to be able to display values from the database in alphabetical order while storing their IDs.</p>
]]></description>
        	        	<pubDate>Mon, 17 Jun 2013 21:34:05 +0300</pubDate>
        </item>
</channel>
</rss>