<?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: custom local sort with respect of the function as index</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index</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/help/custom-local-sort-with-respect-of-the-function-as-index/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>cbonick1 on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p27731</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p27731</guid>
        	        	<description><![CDATA[</p>
<p>Hi :</p>
<p>Enable search for tableToGrid. I need to do a local search for a specific record. These records in the memory I have brought from a php template, no desire to go back to look at php.</p>
<p>Grateful if you could help</p>
</p>
<p>thanks</p></p>
]]></description>
        	        	<pubDate>Tue, 13 Nov 2012 23:20:21 +0200</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19035</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19035</guid>
        	        	<description><![CDATA[<p>Thanks Oleg. Will look at this as soon as I have time.</p>
</p>
<p>Best Regsrds</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 10 Aug 2010 10:47:52 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19027</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19027</guid>
        	        	<description><![CDATA[<p>Hi Tony!</p>
<p>You are right, the version seems work without any problem, but I made the test with another javascript which use filterToolbar function. A working version you can find here <a href="http://www.ok-soft-gmbh.com/jqGrid/CustomFilter.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....Filter.htm</a>. It is an answer on the question <a href="http://stackoverflow.com/questions/3311929/is-there-a-way-to-programatically-set-a-filter-in-jquery-jqgrid" rel="nofollow" target="_blank"><a href="http://stackoverflow.com/quest" rel="nofollow">http://stackoverflow.com/quest</a>.....ery-jqgrid</a>. The same javascript which use 3.8 and index as function have at the beginning the problem in the line 736 of grid.custom.js:</p>
<p>&#160;&#160; &#160;$(elem).attr({name:cm.index &#124;&#124; cm.name, id: "gs_"+cm.name});</p>
<p>and then in the line 540</p>
<p>&#160;&#160; &#160;v = $("select[name="+nm+"]",$t.grid.hDiv).val();</p>
<p>where nm are set in the line 536 as</p>
<p>&#160;&#160; &#160;nm = this.index &#124;&#124; this.name;</p>
<p>You can see the problem online <a href="http://www.ok-soft-gmbh.com/jqGrid/CustomLocalSort4.htm" rel="nofollow" target="_blank">http://www.ok-soft-gmbh.com/jqGrid/CustomLocalSort4.htm</a>.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Mon, 09 Aug 2010 10:09:41 +0300</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19024</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19024</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>No I mean this</p>
<p><a href="http://www.ok-soft-gmbh.com/jqGrid/CustomLocalSort.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....alSort.htm</a></p>
</p>
<p>with the latest from GitHub.&#160;</p>
<p>I just have test it &#160;(getting your code) and it works with the latest 3.8</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 09 Aug 2010 08:41:30 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19020</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19020</guid>
        	        	<description><![CDATA[<p>Hello Tony!</p>
<p>Probably you mean <strong>sorttype</strong> as function (<strong>index</strong> as function not work starting with 3.7.2, but one way with <strong>sorttype</strong> is enough). It works perfect! The second parameter can be very usefull.</p>
<p>If I&#39;ll find some problems later I&#39;ll post there in the forum.</p>
<p>Thank you!<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 07 Aug 2010 21:46:27 +0300</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19015</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p19015</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Could you please try with the latest from GitHub - I mean to test a index as function.</p>
</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 07 Aug 2010 12:10:41 +0300</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18984</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18984</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Thanks. As usuall very usefull - Added in 3.8.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 05 Aug 2010 15:50:47 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18813</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18813</guid>
        	        	<description><![CDATA[<p>Hi Tony!</p>
<p>I am now back from the vocation and could test the new release of jqGrid with <strong>sorttype</strong> as function. Thank you very much! It works!</p>
<p>One more information about my original suggestion with the usage of <strong>index</strong> as a function. It works good with jqGrid 3.7 and 3.7.1, <strong>but don&#39;t work more on 3.7.2</strong>. The function from the <strong>index</strong> will be forward (in the version 3.7.1) to the <strong>expr</strong> parameter of <strong>getAccessor</strong> function. A working example with jqGrid 3.7.1 you can see here <a href="http://www.ok-soft-gmbh.com/jqGrid/CustomLocalSort.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....alSort.htm</a></p>
<p>The solution with <strong>sorttype</strong> as function I find very good. The most advantage which I see in the place is because <strong>sorttype</strong> are have sence only with the local data, but <strong>index</strong> on the other side not only for the local data.</p>
<p>The only restriction of the current implementation of <strong>sorttype</strong> as function is that it has only one parameter <strong>cell</strong> (<strong>getAccessor</strong> function has <strong>obj</strong> parameter instead), but no other information about the object which are sorted. This chould be not enough for some advance scenarios. So what do you think about the changing of the following lines</p>
<p>ab = $.jgrid.getAccessor(v,by);<br />if(ab === undefined) { ab = ""; }<br />ab = findSortKey(ab);<br />_sortData.push({ &#39;vSort&#39;: ab,&#39;index&#39;:i});</p>
<p>to</p>
<p>ab = $.jgrid.getAccessor(v,by);<br /> if(ab === undefined) { ab = ""; }<br /> ab = findSortKey(ab<strong>,v</strong>);<br /> _sortData.push({ &#39;vSort&#39;: ab,&#39;index&#39;:i});</p>
<p>Then <strong>findSortKey</strong> will have additional second parameter with full row contain (only without current id). Probably id as a third parameter could be also helpful.</p>
<p>What do you think about, Tony?</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Mon, 26 Jul 2010 14:02:11 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18812</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18812</guid>
        	        	<description><![CDATA[<p>Hi <strong>cjm19682</strong>,</p>
<p>you should use the latest version of jqGrid published on <a href="http://github.com/tonytomov/jqGrid/tree/master" rel="nofollow" target="_blank"><a href="http://github.com/tonytomov/jq" rel="nofollow">http://github.com/tonytomov/jq</a>.....ree/master</a> <strong>after</strong> the release of 3.7.2. Then you will be able to use sorttype as function.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Mon, 26 Jul 2010 13:39:08 +0300</pubDate>
        </item>
        <item>
        	<title>cjm19682 on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18801</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18801</guid>
        	        	<description><![CDATA[<p>I really need to make this idea of a custom sorttype work, and tried using Tony&#39;s idea, but can&#39;t make it work. Please, can anyone help!</p>
</p>
<p>I am using jqGrid 3.7.2 with local data. The code below is my best attempt at getting it to work - I can&#39;t make it call the custom sorting function though. The idea is to sort the &#39;Posn&#39; field in the order &#39;GK&#39;-&#62;&#39;DEF&#39;-&#62;&#39;MID&#39;-&#62;&#39;STR&#39;. &#160;Here is the code I&#39;d like to get working:</p>
</p>
<p>&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&#62;</p>
<p>&#60;html&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;head&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;title&#62;Table Testbed&#60;/title&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&#62;</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>&#60;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/south-street/jquery-ui.css"&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&#62;&#60;/script&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&#62;&#60;/script&#62;</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>&#60;link rel="stylesheet" type="text/css" href="/thirdParty/jqGrid/ui.jqgrid.css" &#62;</p>
<p><span style="white-space: pre;"> </span>&#60;script type="text/javascript" src="/thirdParty/jqGrid/grid.locale-en.js"&#62;&#60;/script&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;script type="text/javascript" src="/thirdParty/jqGrid/jquery.jqGrid.min.js"&#62;&#60;/script&#62;</p>
</p>
<p><span style="white-space: pre;"> </span>&#60;script type="text/javascript"&#62;</p>
<p><span style="white-space: pre;"> </span>$().ready(function()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>tableToGrid("#playerTable",</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>datatype:<span style="white-space: pre;"> </span>"local",</p>
<p><span style="white-space: pre;"> </span>sortable:<span style="white-space: pre;"> </span>true,</p>
<p><span style="white-space: pre;"> </span>hidegrid:<span style="white-space: pre;"> </span>false,</p>
<p><span style="white-space: pre;"> </span>multiselect: <span style="white-space: pre;"> </span>false,</p>
<p><span style="white-space: pre;"> </span>altRows:<span style="white-space: pre;"> </span>true,</p>
<p><span style="white-space: pre;"> </span>height: <span style="white-space: pre;"> </span>"100%",&#160;</p>
<p><span style="white-space: pre;"> </span>width:<span style="white-space: pre;"> </span>"155px",</p>
<p><span style="white-space: pre;"> </span>shrinkToFit:<span style="white-space: pre;"> </span>true,</p>
<p><span style="white-space: pre;"> </span>rowNum: 100,</p>
<p><span style="white-space: pre;"> </span>colNames:<span style="white-space: pre;"> </span>[&#39;Posn&#39;,&#39;Name&#39;],</p>
<p><span style="white-space: pre;"> </span>colModel:<span style="white-space: pre;"> </span>[</p>
<p><span style="white-space: pre;"> </span>{name:&#39;Posn&#39;, index:&#39;Posn&#39;, width:100, sorttype:</p>
<p><span style="white-space: pre;"> </span>function(cell)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>if (cell==&#39;GK&#39;) return &#39;0&#39;;</p>
<p><span style="white-space: pre;"> </span>if (cell==&#39;DEF&#39;) return &#39;1&#39;;</p>
<p><span style="white-space: pre;"> </span>if (cell==&#39;MID&#39;) return &#39;2&#39;;</p>
<p><span style="white-space: pre;"> </span>if (cell==&#39;STR&#39;) return &#39;3&#39;;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>},</p>
<p><span style="white-space: pre;"> </span>{name:&#39;Name&#39;, index:&#39;Name&#39;, width:200, sorttype:"text"}</p>
<p><span style="white-space: pre;"> </span>]</p>
<p><span style="white-space: pre;"> </span>});</p>
<p><span style="white-space: pre;"> </span>});</p>
<p><span style="white-space: pre;"> </span>&#60;/script&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;/head&#62;</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>&#60;body&#62;</p>
<p><span style="white-space: pre;"> </span>&#60;table id="playerTable"&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;thead&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;th&#62;Posn&#60;/th&#62;&#60;th&#62;Name&#60;/th&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;/thead&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tbody&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;GK&#60;/td&#62;&#60;td&#62;Almunia&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;GK&#60;/td&#62;&#60;td&#62;Fabianski&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;DEF&#60;/td&#62;&#60;td&#62;Campbell&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;DEF&#60;/td&#62;&#60;td&#62;Clichy&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;MID&#60;/td&#62;&#60;td&#62;Denilson&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;MID&#60;/td&#62;&#60;td&#62;Diaby&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;STR&#60;/td&#62;&#60;td&#62;Arshavin&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;tr&#62;&#60;td&#62;STR&#60;/td&#62;&#60;td&#62;Bendtner&#60;/td&#62;&#60;/tr&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;/tbody&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;/table&#62;&#160;</p>
<p><span style="white-space: pre;"> </span>&#60;/body&#62;</p>
<p>&#60;/html&#62;</p>
<div></div>
]]></description>
        	        	<pubDate>Sat, 24 Jul 2010 12:02:16 +0300</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18680</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18680</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Just found a very simple solution. Will publish it tommorow.</p>
<p>Also the idea is to define not a index, but a sorttype as function.</p>
<p>Just tested and work ok.</p>
<p>{ name: &#39;Category&#39;, width: 200, formatter:&#39;select&#39;,</p>
<p>sorttype: function(cell) {<br />&#160;&#160;&#160;&#160;&#160;&#160;  return categories[cell];</p>
<p>// celll represent values from 0 to 1 as of your data</p>
<p>},</p>
</p>
<p>Regards</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">&#160;&#160; &#160;&#160;&#160;&#160; _stripNum = /[\$,%]/g,
</div>
]]></description>
        	        	<pubDate>Mon, 19 Jul 2010 23:32:57 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18679</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18679</guid>
        	        	<description><![CDATA[<p>Sorry Tony, I understand that the current version jqGrid not use formatters for local data. Nevertheless atfer some debugging and examine of code, it seems to me that I do found a solution of the problem which I posted. This is the using of <strong>functions</strong> as <strong>index</strong>. The example which I posted seems good working. I asked the question mostly to be sure that the usage of functions as <strong>index</strong> is and will be a supported feature of jqGrid. It seems to work very good with local data. Please try the code example and say your opinion about. If you like this, it can be an oficial documanted feature of jqGrid and one could use it for any kind of custom sorting of local data.</p>
<p>Thanks<br />Oleg</p>
]]></description>
        	        	<pubDate>Mon, 19 Jul 2010 21:13:50 +0300</pubDate>
        </item>
        <item>
        	<title>tony on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18672</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18672</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Thanks - this is a good recommendation, but it can not be realized currently.</p>
<p>The maydata in your case is stored into the grid as it is. Think of it as saved json request, which will be called with diffrent conditions.</p>
<p>If you perform sort we get the values from mydata and not the displayed one from the formatters.</p>
<p>Instead this is very usefull feature.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 19 Jul 2010 16:43:59 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on custom local sort with respect of the function as index</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18636</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-local-sort-with-respect-of-the-function-as-index#p18636</guid>
        	        	<description><![CDATA[<p>Hi Tony!</p>
<p>I had some problems with using of selects in the jqGrid 3.7.x where is set <strong>formatter:&#39;select&#39;</strong> on a column (and holding integer values in the data table instead of strings). As a workaround I find out a solution where I used function as a value of <strong>index</strong> property of the corresponding column.</p>
<p>Here is a small example which reproduce the problem and the workaround:</p>
<p>var categories = ["sport", "science"];<br />var subcategories = ["football", "formel 1", "physics", "mathematics"];<br />var mydata = [<br />&#160;&#160;&#160; {id:0, Name:"Lukas Podolski",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Category:0, Subcategory:0},<br />&#160;&#160;&#160; {id:1, Name:"Michael Schumacher", Category:0, Subcategory:1},<br />&#160;&#160;&#160; {id:2, Name:"Albert Einstein",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Category:1, Subcategory:2},<br />&#160;&#160;&#160; {id:3, Name:"Blaise Pascal",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Category:1, Subcategory:3}<br />];</p>
<p>var grid = jQuery("#list").jqGrid({<br />&#160;&#160;&#160; data: mydata,<br />&#160;&#160;&#160; datatype: &#39;local&#39;,<br />&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Name&#39;, width: 200 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Category&#39;, width: 200, formatter:&#39;select&#39;, //sorttype:&#39;int&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: function(obj) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return categories[obj.Category];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#39;select&#39;, editoptions: { value: categories }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Subcategory&#39;, width: 200, formatter:&#39;select&#39;, //sorttype:&#39;int&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: function(obj) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return subcategories[obj.Subcategory];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#39;select&#39;, editoptions: { value: subcategories} }<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; sortname: &#39;Name&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; rownumbers: true,<br />&#160;&#160;&#160; sortorder: "desc",<br />&#160;&#160;&#160; pager: &#39;#pager&#39;,<br />&#160;&#160;&#160; caption: "Custom Local Sort"<br />}).navGrid(&#39;#pager&#39;, { edit: false, add: false, del: false, search: false, refresh:false });</p>
<p>Because I didn&#39;t seen the usage of of <strong>index</strong> property  as function I want ask you to conform, that it is OK to do this.</p>
<p>Best regards</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Fri, 16 Jul 2010 16:59:24 +0300</pubDate>
        </item>
</channel>
</rss>