<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Find as you type sorting on large record sets</title>
	<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/</link>
	<description>Hacking away at UI development</description>
	<pubDate>Fri, 12 Mar 2010 12:22:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Cornelius</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-66</link>
		<dc:creator>Cornelius</dc:creator>
		<pubDate>Fri, 18 Apr 2008 15:51:50 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-66</guid>
		<description>Hi,

thanks for the code, it really helped a lot. I found a little flaw in it: If the user types in a number which matches an index in the filtertext variable the first XML node is returned.

To avoid this change
[code]
pos = attributelist.indexOf(term, i);
if(pos &#62; -1){
  index = int( attributelist.substring(attributelist.indexOf("", pos)) );
  output[count] = list[index];
  count++;
  i = pos+term.length;
}
[/code]

to

[code]
pos = attributelist.indexOf(term, i);
if(pos &#62; -1){
  if (attributelist.charAt(pos-1) != "&#60;"){
    index = int( attributelist.substring(attributelist.indexOf("", pos)) );
    output[count] = list[index];
    count++;
  }
  i = (pos + term.length &#60; attributelist.length) ? pos + term.length : -1;
}
[/code]


I hope I got the code highlighting right ;)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>thanks for the code, it really helped a lot. I found a little flaw in it: If the user types in a number which matches an index in the filtertext variable the first XML node is returned.</p>
<p>To avoid this change<br />
[code]<br />
pos = attributelist.indexOf(term, i);<br />
if(pos &gt; -1){<br />
  index = int( attributelist.substring(attributelist.indexOf(&#8221;", pos)) );<br />
  output[count] = list[index];<br />
  count++;<br />
  i = pos+term.length;<br />
}<br />
[/code]</p>
<p>to</p>
<p>[code]<br />
pos = attributelist.indexOf(term, i);<br />
if(pos &gt; -1){<br />
  if (attributelist.charAt(pos-1) != &#8220;&lt;&#8221;){<br />
    index = int( attributelist.substring(attributelist.indexOf(&#8221;", pos)) );<br />
    output[count] = list[index];<br />
    count++;<br />
  }<br />
  i = (pos + term.length &lt; attributelist.length) ? pos + term.length : -1;<br />
}<br />
[/code]</p>
<p>I hope I got the code highlighting right <img src='http://www.craftymind.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Christmann</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-10</link>
		<dc:creator>Sean Christmann</dc:creator>
		<pubDate>Mon, 03 Mar 2008 02:49:41 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-10</guid>
		<description>Hey guys, I just moved over to a new publishing system so the code above should be showing correctly now.</description>
		<content:encoded><![CDATA[<p>Hey guys, I just moved over to a new publishing system so the code above should be showing correctly now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Wright</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-9</link>
		<dc:creator>John Wright</dc:creator>
		<pubDate>Fri, 02 Nov 2007 02:32:24 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-9</guid>
		<description>Actually, that is wrong above. It should be:

i = attributelist.indexOf(”&#62;”, pos);

don’t add the pos, that will mess things up.</description>
		<content:encoded><![CDATA[<p>Actually, that is wrong above. It should be:</p>
<p>i = attributelist.indexOf(”&gt;”, pos);</p>
<p>don’t add the pos, that will mess things up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Wright</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-8</link>
		<dc:creator>John Wright</dc:creator>
		<pubDate>Wed, 31 Oct 2007 02:32:07 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-8</guid>
		<description>Arne, I found a solution for multiple fields. In the searchStringInAttribute method replace the setting of the new search position with this line:

i = pos + attributelist.indexOf(”&#62;”, pos);

instead of what it is currently. This way when 1 match is found in the row it will go onto the next row.</description>
		<content:encoded><![CDATA[<p>Arne, I found a solution for multiple fields. In the searchStringInAttribute method replace the setting of the new search position with this line:</p>
<p>i = pos + attributelist.indexOf(”&gt;”, pos);</p>
<p>instead of what it is currently. This way when 1 match is found in the row it will go onto the next row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arand</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-7</link>
		<dc:creator>arand</dc:creator>
		<pubDate>Thu, 18 Oct 2007 02:31:34 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-7</guid>
		<description>I added code to pull additional text from other attributes however sometimes there are multiple occurrences of search term and the output will send multiple instances of that node. Any way to prevent that?</description>
		<content:encoded><![CDATA[<p>I added code to pull additional text from other attributes however sometimes there are multiple occurrences of search term and the output will send multiple instances of that node. Any way to prevent that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arne</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-6</link>
		<dc:creator>Arne</dc:creator>
		<pubDate>Wed, 16 May 2007 02:31:16 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-6</guid>
		<description>Now I understand: “ins” and ”\ins” as tags are some artefacts of your blogging tool; both should just be ”+” in AS code.

Sorry :-)</description>
		<content:encoded><![CDATA[<p>Now I understand: “ins” and ”\ins” as tags are some artefacts of your blogging tool; both should just be ”+” in AS code.</p>
<p>Sorry <img src='http://www.craftymind.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arne</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-5</link>
		<dc:creator>Arne</dc:creator>
		<pubDate>Wed, 16 May 2007 02:30:58 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-5</guid>
		<description>I don´t get it; what exactly happens here:
———
for each(node in rawXMLList){
fullNameIndex = node.@fullName.toLowerCase()””; count++; }
——
What is this about and where does this come from?
I am very curious, because I need more XML parsing speed very urgent.

Kind regards
______
Arne</description>
		<content:encoded><![CDATA[<p>I don´t get it; what exactly happens here:<br />
———<br />
for each(node in rawXMLList){<br />
fullNameIndex = <a href="mailto:node.@fullName.toLowerCase">node.@fullName.toLowerCase</a>()””; count++; }<br />
——<br />
What is this about and where does this come from?<br />
I am very curious, because I need more XML parsing speed very urgent.</p>
<p>Kind regards<br />
______<br />
Arne</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-4</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Wed, 11 Apr 2007 02:30:07 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-4</guid>
		<description>i’m so glad i found this page on google, i’m trying to implement exactly what you’re talking about (iTunes-like search on a directory with a huge XML dataset) and am running into issues with search speeds… was trying to do it in AS2 and flash but after reading your extremely helpful and enlightening post i’m going to start educating myself in AS3 and flex. thanks again for the great information and inspiration!</description>
		<content:encoded><![CDATA[<p>i’m so glad i found this page on google, i’m trying to implement exactly what you’re talking about (iTunes-like search on a directory with a huge XML dataset) and am running into issues with search speeds… was trying to do it in AS2 and flash but after reading your extremely helpful and enlightening post i’m going to start educating myself in AS3 and flex. thanks again for the great information and inspiration!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-3</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 28 Mar 2007 02:29:43 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-3</guid>
		<description>I actually found myself saying “crafty” while reading this post. :)

Thanks!</description>
		<content:encoded><![CDATA[<p>I actually found myself saying “crafty” while reading this post. <img src='http://www.craftymind.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-2</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Mon, 26 Mar 2007 02:29:12 +0000</pubDate>
		<guid>http://www.craftymind.com/2007/02/11/find-as-you-type-sorting-on-large-record-sets/#comment-2</guid>
		<description>I just watched your demo from Apollo Camp, and this was one of the things I was curious about. Thanks for the details. Great stuff.</description>
		<content:encoded><![CDATA[<p>I just watched your demo from Apollo Camp, and this was one of the things I was curious about. Thanks for the details. Great stuff.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
