<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>JavaScript filter/search in table</title>
    <link>http://leparlement.org/filterTable/index.rss</link>
    <description>JavaScript filter/search in table</description>
    <item>
      <title>Re: JavaScript filter search in table</title>
      <pubDate>2010-02-26 10:02:00+0100</pubDate>
      <link>http://leparlement.org/Re_JavaScript_filter_search_in_table</link>
      <comments>http://leparlement.org/Re_JavaScript_filter_search_in_table</comments>
      <dc:creator>echarp</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;I&amp;#8217;ll gladly send it to you, to what email address?&lt;/p&gt;
&lt;p&gt;Normally just clicking on the following link should open the javascript file for you: &lt;a href="http://blog.echarp.org/attachment/file/filterTable/filterTable.js"&gt;http://blog.echarp.org/attachment/file/filterTable/filterTable.js&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then save it locally and move this file into whatever directory you use for your javascript files.&lt;/p&gt;
&lt;p&gt;Once this is done, you can test the feature with the html code present in this article: it include the js file in the html file, and uses it through the addition of class &amp;#8220;filterable&amp;#8221; to the html table itself. The highlight is managed through a bit of css.&lt;/p&gt;
&lt;p&gt;You can also contact me on irc, server irc.freenode.net, I&amp;#8217;m generally on #parlement.&lt;/p&gt;
&lt;p&gt;+1 Thanks for your feedback on this!&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>JavaScript filter search in table</title>
      <pubDate>2010-02-25 21:22:43+0100</pubDate>
      <link>http://leparlement.org/JavaScript_filter_search_in_table</link>
      <comments>http://leparlement.org/JavaScript_filter_search_in_table</comments>
      <dc:creator>Johannes</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;Hey Echarp,&lt;/p&gt;
&lt;p&gt;this is a really cool tool. &lt;br/&gt;
But I have a problem to transfer it to a different page. Even if I save your page to my desktop with the .js-file (path is adjusted) it doesnt work. 
The example from &amp;#8220;vonloesch&amp;#8221; works, but I want the highlighting thing.&lt;/p&gt;
&lt;p&gt;Can somebody be so kind a post or send me the naked .html-file and the .js-file? You would really do me a favor!&lt;/p&gt;
&lt;p&gt;Thanks in advance and kind regards!&lt;br/&gt;
Johannes&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Speeding it up?</title>
      <pubDate>2009-11-12 13:57:51+0100</pubDate>
      <link>http://leparlement.org/Re_Speeding_it_up_1</link>
      <comments>http://leparlement.org/Re_Speeding_it_up_1</comments>
      <dc:creator>JavaScript simple examples</dc:creator>
      <description>&lt;p&gt;-1&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Multiple table filter</title>
      <pubDate>2009-08-16 23:09:35+0200</pubDate>
      <link>http://leparlement.org/Re_Multiple_table_filter_3</link>
      <comments>http://leparlement.org/Re_Multiple_table_filter_3</comments>
      <dc:creator>echarp</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;I&amp;#8217;m not sure about your goal, you want &amp;#8220;one&amp;#8221; filter to filter over many tables? Input filter should be present above the first one then?&lt;/p&gt;
&lt;p&gt;First you can &amp;#8220;only&amp;#8221; add the filter form if you are in the first table:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;pre&amp;gt;&lt;/p&gt;
&lt;p&gt;if (t == 0 &amp;amp;&amp;amp; element.attributes[&amp;#8216;class&amp;#8217;] &amp;amp;&amp;amp; &amp;#8230;) {
  &amp;#8230;
}&lt;/p&gt;
&lt;p&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;(at the end of the javascript file)&lt;/p&gt;
&lt;p&gt;Then in the &lt;code&gt;filterTable(input, element);&lt;/code&gt; part, reloop over all tables to add each to the onkeyup event.&lt;/p&gt;
&lt;p&gt;Something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;pre&amp;gt;&lt;/p&gt;
for (var t2 = 0; t2 &amp;lt; tables.length; t2++) {
element2 = tables[t];
filterTable(input, element2);
}
&lt;p&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s just one way to do it, simple. You tell me if it&amp;#8217;s good.&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Multiple table filter</title>
      <pubDate>2009-08-10 20:08:54+0200</pubDate>
      <link>http://leparlement.org/Re_Multiple_table_filter_2</link>
      <comments>http://leparlement.org/Re_Multiple_table_filter_2</comments>
      <dc:creator>Sam</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;Sorry it tried to compile the form at the end of the script,&lt;/p&gt;
&lt;p&gt;I had tried to use the same basic version of your form with the form calling the function filter(this,&amp;#8216;Id1&amp;#8217;,&amp;#8216;Id2&amp;#8217;,&amp;#8216;Id3&amp;#8217;,1)&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Multiple table filter</title>
      <pubDate>2009-08-10 19:52:00+0200</pubDate>
      <link>http://leparlement.org/Re_Multiple_table_filter_1</link>
      <comments>http://leparlement.org/Re_Multiple_table_filter_1</comments>
      <dc:creator>Sam</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;So would that in effect get the filter function to repeat the process over a number of table references? Would &amp;#8216;toFilter&amp;#8217; have to be classified as a collection of table Id&amp;#8217;s? Sorry I&amp;#8217;m very much a beginner when it comes to this, trying to learn though.&lt;/p&gt;
&lt;p&gt;Do you think something along the lines below would work, please be as critical as you can. Thankyou so much for your help.&lt;/p&gt;
&lt;p&gt;function filter (phrase, &lt;em&gt;id1,&lt;em&gt;id2,&lt;/em&gt;id3){
	var words = phrase.value.toLowerCase().split(&amp;quot; &amp;quot;);
	var table = document.getElementById(&lt;/em&gt;id1);
	var ele;
	for (var r = 1; r &amp;lt; table.rows.length; r++){
		ele = table.rows&amp;#174;.innerHTML.replace(/&amp;lt;[^&amp;gt;]&lt;ins&gt;&amp;gt;/g,&amp;quot;&amp;quot;);
	        var displayStyle = &amp;#8216;none&amp;#8217;;
	        for (var i = 0; i &amp;lt; words.length; i&lt;/ins&gt;+) {
		    if (ele.toLowerCase().indexOf(words[i])&amp;gt;=0)
			displayStyle = &amp;#8217;&amp;#8217;;&lt;/p&gt;
var words = phrase.value.toLowerCase().split(&amp;quot; &amp;quot;);
&lt;p&gt;var table = document.getElementById(_id2);
	var ele;
	for (var r = 1; r &amp;lt; table.rows.length; r++){
		ele = table.rows&amp;#174;.innerHTML.replace(/&amp;lt;[^&amp;gt;]&lt;ins&gt;&amp;gt;/g,&amp;quot;&amp;quot;);
	        var displayStyle = &amp;#8216;none&amp;#8217;;
	        for (var i = 0; i &amp;lt; words.length; i&lt;/ins&gt;+) {
		    if (ele.toLowerCase().indexOf(words[i])&amp;gt;=0)
			displayStyle = &amp;#8217;&amp;#8217;;&lt;/p&gt;
var words = phrase.value.toLowerCase().split(&amp;quot; &amp;quot;);
&lt;p&gt;var table = document.getElementById(_id3);
	var ele;
	for (var r = 1; r &amp;lt; table.rows.length; r++){
		ele = table.rows&amp;#174;.innerHTML.replace(/&amp;lt;[^&amp;gt;]&lt;ins&gt;&amp;gt;/g,&amp;quot;&amp;quot;);
	        var displayStyle = &amp;#8216;none&amp;#8217;;
	        for (var i = 0; i &amp;lt; words.length; i&lt;/ins&gt;+) {
		    if (ele.toLowerCase().indexOf(words[i])&amp;gt;=0)
			displayStyle = &amp;#8217;&amp;#8217;;&lt;/p&gt;
&lt;p&gt;else {
			displayStyle = &amp;#8216;none&amp;#8217;;
			break;
		    }
	        }
		table.rows&amp;#174;.style.display = displayStyle;
	}
}&lt;/p&gt;
&lt;form&gt;
&lt;input name="filter" onkeyup="filter(this, 'id1','id2','id3', 1)" type="text"&gt;
&lt;/form&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Multiple table filter</title>
      <pubDate>2009-08-10 14:46:29+0200</pubDate>
      <link>http://leparlement.org/Re_Multiple_table_filter</link>
      <comments>http://leparlement.org/Re_Multiple_table_filter</comments>
      <dc:creator>echarp</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;It&amp;#8217;s definitely something you can do, yes&lt;/p&gt;
&lt;p&gt;This implies some modifications to the javascript, so that instead of filtering &lt;strong&gt;one&lt;/strong&gt; table, it would filter all tables which are contained in a specific part of the page.&lt;/p&gt;
&lt;p&gt;For example:
&lt;code&gt;document.getElementById('toFilter');&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And wherever there is a loop over the table&amp;#8217;s rows, you should add an extra loop around it, to loop over all sub tables.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll gladly help you if you want to try it.&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiple table filter</title>
      <pubDate>2009-08-07 15:25:25+0200</pubDate>
      <link>http://leparlement.org/Multiple_table_filter</link>
      <comments>http://leparlement.org/Multiple_table_filter</comments>
      <dc:creator>Sam</dc:creator>
      <description>&lt;p&gt;This is a great little script! Is there a way of getting the search function to filter more than one table simultaneously by playing with the table id&amp;#8217;s? I have tried but unfortunately failed to get it to work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Re: Speeding it up?</title>
      <pubDate>2008-11-28 17:40:50+0100</pubDate>
      <link>http://leparlement.org/Re_Speeding_it_up</link>
      <comments>http://leparlement.org/Re_Speeding_it_up</comments>
      <dc:creator>echarp</dc:creator>
      <description>&lt;p&gt;&lt;p&gt;You could try removing some of the features.&lt;/p&gt;
&lt;p&gt;For example the script is checking and highlighting individual words, can be removed easily (see the &amp;#8220;dehighlight&amp;#8221; and highlight&amp;quot; methods).&lt;/p&gt;
&lt;p&gt;Already this should give you more reactivity over a large table.&lt;/p&gt;
&lt;p&gt;+1&lt;/p&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Speeding it up?</title>
      <pubDate>2008-11-22 19:42:01+0100</pubDate>
      <link>http://leparlement.org/Speeding_it_up</link>
      <comments>http://leparlement.org/Speeding_it_up</comments>
      <dc:creator>Matthew</dc:creator>
      <description>&lt;p&gt;I like this script, but am trying to use it on a large table (4 columns and about 165 rows), so it is slow.  Do you have any suggestions for how to speed it up?  When I add a submit button it does help, but still takes about 10-15 seconds to return the search results.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
