[jQuery] Quicksearch

2009-09-18 Thread Charlie

I am trying to use quicksearch on tables that have input boxes in each
of the   and have found that the quicksearch does not
search the values of each of those input boxes.  Does anyone know a
way to get quicksearch to include the input boxes?

Thanks


[jQuery] Quicksearch. How to match only the beginning of a word?

2009-09-11 Thread minbo

Hello,

I'm using the Quicksearch plug-in and it does everything I need except
for one thing.

If I have two rows, for example:
"Blood oranges" and
"Green apples"

and I search for "a", it's going to match both rows because it matches
the "a" in "oranges".

What I need to is to match only the beginning of each word, so that
typing "a" in this case
would only give me "Green apples".

Does anyone know if this is possible?

Thank you for your help!



[jQuery] Another jQuery Quicksearch Plugin question

2008-11-22 Thread russellneufeld

Hi all,

  Just learned about the quicksearch plugin from a couple of posts
yesterday.  Very cool.  Thanks for writing and sharing it.

  I have a table which is filled in periodically from some
asynchronous calls.  That is, when the page initially loads, the table
is empty.  As search results come in, the table is populated.  There
may be several updates to the table.  I'd like to use quicksearch with
the table, and it works provided that I call

 $('table#table_example tbody tr').quicksearch( {...} )

after the last bit of data has been loaded into the table.  However,
I'd like to provide quicksearch functionality while the table is only
partially loaded.  I'm not a jquery or javascript wiz, but from
looking at the quicksearch source it appears that I need to call
get_cache(el) after each update to the table.   I'm not sure how to
get a reference to the object to call get_cache(el) on.  I hacked the
quicksearch code so that at the end of the quicksearch() function it
returns "this", figuring I'd get back a reference to the object which
has the get_cache() method.  I expected to be able to do something
like this:

 quicksearch_obj = $('table#table_example tbody tr').quicksearch
( {...} );

 // For every table update, do this:
 quicksearch_obj.get_cache(quicksearch_obj);

However that didn't work.  I tried a bunch of variations on that, but
had no success.

Anyone got any ideas?  Thanks in advance,

  Russ


[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread abovegaucho
Good to know...again thanks for helping me with this. Hope you have a
good rest of today.

On Nov 21, 2:53 pm, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> That's due to the script taking too much time to parse the
> information, it's just one of those things that will happen when you
> have such a large data set to iterate over
>
> Rik
>
> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> > Rik that worked!  The only thing that I can't seem to explain is why I
> > get a box that reads:
>
> > "A script on this page may be busy, or it may have stopped responding.
> > You can stop the script now, or you can continue to see if the script
> > will complete.
>
> > Script:http://localhost/sort/js/jquery-1.2.6.pack.js:11";
>
> > Only inf FireFox?  Any suggestions?
>
> > On Nov 21, 11:42 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> >> I would increase the delay to something like 1000, that may help 
> >> performance
>
> >> I think the problem with taking the delay out is the comma at the end
> >> of the labelText bit, IE doesn't like those missing commas in objects
>
> >> Rik
>
> >> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> >> > I see...
>
> >> > All I have there is very basic things
>
> >> > 
> >> > $(document).ready(function () {
> >> > $('table tbody tr').quicksearch({
> >> > position: 'before',
> >> > attached: 'table',
> >> > labelText: 'Search the GPI Fuel Product Manuals',
> >> > delay: 50
> >> >                        });
> >> > })
> >> > 
>
> >> > If i take the delay:50 out I don't get a search box.  Sorry to be such
> >> > a pain...
>
> >> > On Nov 21, 11:27 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> >> >> I meant in the options, so when you do $(...).quicksearch( options );
> >> >> there isn't anything other than the basic stuff you need in the object
> >> >> you're passing through
>
> >> >> Rik
>
> >> >> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> >> >> > First I must say that I really like your plugin...and I did go and
> >> >> > read some other stuff on your site about your latest
> >> >> > plugin...congrats!
>
> >> >> > I have the following options in the jquery.quicksearch.js file...I
> >> >> > believe that row striping is off...but I am not much of a programmer
> >> >> > so let me know what I need to do if I haven't done your suggestions.
>
> >> >> > ;(function( $ ){
> >> >> >        $.fn.quicksearch = function(options) {
>
> >> >> >                options = jQuery.extend({
> >> >> >                        position: 'prepend',
> >> >> >                        attached: 'body',
> >> >> >                        formId: 'quicksearch',
> >> >> >                        labelText: 'Quick Search',
> >> >> >                        labelClass: 'qs_label',
> >> >> >                        inputText: null,
> >> >> >                        inputClass: 'qs_input',
> >> >> >                        loaderId: 'loader',
> >> >> >                        loaderClass: 'loader',
> >> >> >                        loaderImg: null,
> >> >> >                        loaderText: '',
> >> >> >                        stripeRowClass: null,
> >> >> >                        hideElement: null,
> >> >> >                        delay: 500,
> >> >> >                        focusOnLoad: false,
> >> >> >                        onBefore: null,
> >> >> >                        onAfter: null,
> >> >> >                        filter: null,
> >> >> >                        randomElement: 
> >> >> > 'qs'+Math.floor(Math.random()*100)
> >> >> >                }, options);
>
> >> >> >                var timeout;
> >> >> >                var cache;
> >> >> >                var score = {};
> >> >> >                var el = this;
> >> >> >                var stripeRowLength = 
> >> >> > (!is_empty(options.stripeRowClass)) ?
> >> >> > options.stripeRowClass.length : 0;
> >> >> >                var doStripe = (stripeRowLength > 0) ? true : false;
>
> >> >> >                function is_empty (i)
> >> >> >                {
> >> >> >                        return (i == null || i == undefined || i == 
> >> >> > false) ? true: false;
> >> >> >                }
>
> >> >> >                function get_cache (el)
> >> >> >                {
> >> >> >                        cache = 
> >> >> > $(el).not('.'+options.noResultsClass).map(function(){
> >> >> >                                return 
> >> >> > strip_html(normalise(this.innerHTML));
> >> >> >                        });
> >> >> >                }
>
> >> >> >                function normalise (i)
> >> >> >                {
> >> >> >                        return $.trim(i.toLowerCase().replace(/\n/, 
> >> >> > '').replace(/\s{2,}/, '
> >> >> > '));
> >> >> >                }
>
> >> >> >                function get_key()
> >> >> >                {
> >> >> >                        var input = 
> >> >> > strip_html(normalise($('input[rel="' +
> >> >> > options.randomElement + '"]').val()));
>
> >> >> >                        if (typeof options.filter == "function") { 
> >> >> > input = optio

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread Rik Lomas

That's due to the script taking too much time to parse the
information, it's just one of those things that will happen when you
have such a large data set to iterate over

Rik


2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
> Rik that worked!  The only thing that I can't seem to explain is why I
> get a box that reads:
>
> "A script on this page may be busy, or it may have stopped responding.
> You can stop the script now, or you can continue to see if the script
> will complete.
>
> Script: http://localhost/sort/js/jquery-1.2.6.pack.js:11";
>
> Only inf FireFox?  Any suggestions?
>
>
> On Nov 21, 11:42 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
>> I would increase the delay to something like 1000, that may help performance
>>
>> I think the problem with taking the delay out is the comma at the end
>> of the labelText bit, IE doesn't like those missing commas in objects
>>
>> Rik
>>
>> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>>
>> > I see...
>>
>> > All I have there is very basic things
>>
>> > 
>> > $(document).ready(function () {
>> > $('table tbody tr').quicksearch({
>> > position: 'before',
>> > attached: 'table',
>> > labelText: 'Search the GPI Fuel Product Manuals',
>> > delay: 50
>> >});
>> > })
>> > 
>>
>> > If i take the delay:50 out I don't get a search box.  Sorry to be such
>> > a pain...
>>
>> > On Nov 21, 11:27 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
>> >> I meant in the options, so when you do $(...).quicksearch( options );
>> >> there isn't anything other than the basic stuff you need in the object
>> >> you're passing through
>>
>> >> Rik
>>
>> >> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>>
>> >> > First I must say that I really like your plugin...and I did go and
>> >> > read some other stuff on your site about your latest
>> >> > plugin...congrats!
>>
>> >> > I have the following options in the jquery.quicksearch.js file...I
>> >> > believe that row striping is off...but I am not much of a programmer
>> >> > so let me know what I need to do if I haven't done your suggestions.
>>
>> >> > ;(function( $ ){
>> >> >$.fn.quicksearch = function(options) {
>>
>> >> >options = jQuery.extend({
>> >> >position: 'prepend',
>> >> >attached: 'body',
>> >> >formId: 'quicksearch',
>> >> >labelText: 'Quick Search',
>> >> >labelClass: 'qs_label',
>> >> >inputText: null,
>> >> >inputClass: 'qs_input',
>> >> >loaderId: 'loader',
>> >> >loaderClass: 'loader',
>> >> >loaderImg: null,
>> >> >loaderText: '',
>> >> >stripeRowClass: null,
>> >> >hideElement: null,
>> >> >delay: 500,
>> >> >focusOnLoad: false,
>> >> >onBefore: null,
>> >> >onAfter: null,
>> >> >filter: null,
>> >> >randomElement: 
>> >> > 'qs'+Math.floor(Math.random()*100)
>> >> >}, options);
>>
>> >> >var timeout;
>> >> >var cache;
>> >> >var score = {};
>> >> >var el = this;
>> >> >var stripeRowLength = 
>> >> > (!is_empty(options.stripeRowClass)) ?
>> >> > options.stripeRowClass.length : 0;
>> >> >var doStripe = (stripeRowLength > 0) ? true : false;
>>
>> >> >function is_empty (i)
>> >> >{
>> >> >return (i == null || i == undefined || i == 
>> >> > false) ? true: false;
>> >> >}
>>
>> >> >function get_cache (el)
>> >> >{
>> >> >cache = 
>> >> > $(el).not('.'+options.noResultsClass).map(function(){
>> >> >return 
>> >> > strip_html(normalise(this.innerHTML));
>> >> >});
>> >> >}
>>
>> >> >function normalise (i)
>> >> >{
>> >> >return $.trim(i.toLowerCase().replace(/\n/, 
>> >> > '').replace(/\s{2,}/, '
>> >> > '));
>> >> >}
>>
>> >> >function get_key()
>> >> >{
>> >> >var input = strip_html(normalise($('input[rel="' 
>> >> > +
>> >> > options.randomElement + '"]').val()));
>>
>> >> >if (typeof options.filter == "function") { input 
>> >> > = options.filter
>> >> > (input); }
>>
>> >> >if (input.indexOf(' ') == -1)
>> >> >{
>> >> >return input;
>> >> >}
>> >> >else
>> >> >{
>> >> >return input.split(

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread abovegaucho
Rik that worked!  The only thing that I can't seem to explain is why I
get a box that reads:

"A script on this page may be busy, or it may have stopped responding.
You can stop the script now, or you can continue to see if the script
will complete.

Script: http://localhost/sort/js/jquery-1.2.6.pack.js:11";

Only inf FireFox?  Any suggestions?


On Nov 21, 11:42 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> I would increase the delay to something like 1000, that may help performance
>
> I think the problem with taking the delay out is the comma at the end
> of the labelText bit, IE doesn't like those missing commas in objects
>
> Rik
>
> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> > I see...
>
> > All I have there is very basic things
>
> > 
> > $(document).ready(function () {
> > $('table tbody tr').quicksearch({
> > position: 'before',
> > attached: 'table',
> > labelText: 'Search the GPI Fuel Product Manuals',
> > delay: 50
> >                        });
> > })
> > 
>
> > If i take the delay:50 out I don't get a search box.  Sorry to be such
> > a pain...
>
> > On Nov 21, 11:27 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> >> I meant in the options, so when you do $(...).quicksearch( options );
> >> there isn't anything other than the basic stuff you need in the object
> >> you're passing through
>
> >> Rik
>
> >> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> >> > First I must say that I really like your plugin...and I did go and
> >> > read some other stuff on your site about your latest
> >> > plugin...congrats!
>
> >> > I have the following options in the jquery.quicksearch.js file...I
> >> > believe that row striping is off...but I am not much of a programmer
> >> > so let me know what I need to do if I haven't done your suggestions.
>
> >> > ;(function( $ ){
> >> >        $.fn.quicksearch = function(options) {
>
> >> >                options = jQuery.extend({
> >> >                        position: 'prepend',
> >> >                        attached: 'body',
> >> >                        formId: 'quicksearch',
> >> >                        labelText: 'Quick Search',
> >> >                        labelClass: 'qs_label',
> >> >                        inputText: null,
> >> >                        inputClass: 'qs_input',
> >> >                        loaderId: 'loader',
> >> >                        loaderClass: 'loader',
> >> >                        loaderImg: null,
> >> >                        loaderText: '',
> >> >                        stripeRowClass: null,
> >> >                        hideElement: null,
> >> >                        delay: 500,
> >> >                        focusOnLoad: false,
> >> >                        onBefore: null,
> >> >                        onAfter: null,
> >> >                        filter: null,
> >> >                        randomElement: 
> >> > 'qs'+Math.floor(Math.random()*100)
> >> >                }, options);
>
> >> >                var timeout;
> >> >                var cache;
> >> >                var score = {};
> >> >                var el = this;
> >> >                var stripeRowLength = (!is_empty(options.stripeRowClass)) 
> >> > ?
> >> > options.stripeRowClass.length : 0;
> >> >                var doStripe = (stripeRowLength > 0) ? true : false;
>
> >> >                function is_empty (i)
> >> >                {
> >> >                        return (i == null || i == undefined || i == 
> >> > false) ? true: false;
> >> >                }
>
> >> >                function get_cache (el)
> >> >                {
> >> >                        cache = 
> >> > $(el).not('.'+options.noResultsClass).map(function(){
> >> >                                return 
> >> > strip_html(normalise(this.innerHTML));
> >> >                        });
> >> >                }
>
> >> >                function normalise (i)
> >> >                {
> >> >                        return $.trim(i.toLowerCase().replace(/\n/, 
> >> > '').replace(/\s{2,}/, '
> >> > '));
> >> >                }
>
> >> >                function get_key()
> >> >                {
> >> >                        var input = strip_html(normalise($('input[rel="' +
> >> > options.randomElement + '"]').val()));
>
> >> >                        if (typeof options.filter == "function") { input 
> >> > = options.filter
> >> > (input); }
>
> >> >                        if (input.indexOf(' ') == -1)
> >> >                        {
> >> >                                return input;
> >> >                        }
> >> >                        else
> >> >                        {
> >> >                                return input.split(" ");
> >> >                        }
> >> >                }
>
> >> >                function test_key(k, value, type)
> >> >                {
> >> >                        if (type == "string")
> >> >                        {
> >> >                                return test_key_string(k, value);
> >> >                        }
> >> >                        else
> >

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread Rik Lomas

I would increase the delay to something like 1000, that may help performance

I think the problem with taking the delay out is the comma at the end
of the labelText bit, IE doesn't like those missing commas in objects

Rik

2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
> I see...
>
> All I have there is very basic things
>
> 
> $(document).ready(function () {
> $('table tbody tr').quicksearch({
> position: 'before',
> attached: 'table',
> labelText: 'Search the GPI Fuel Product Manuals',
> delay: 50
>});
> })
> 
>
> If i take the delay:50 out I don't get a search box.  Sorry to be such
> a pain...
>
> On Nov 21, 11:27 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
>> I meant in the options, so when you do $(...).quicksearch( options );
>> there isn't anything other than the basic stuff you need in the object
>> you're passing through
>>
>> Rik
>>
>> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>>
>>
>>
>> > First I must say that I really like your plugin...and I did go and
>> > read some other stuff on your site about your latest
>> > plugin...congrats!
>>
>> > I have the following options in the jquery.quicksearch.js file...I
>> > believe that row striping is off...but I am not much of a programmer
>> > so let me know what I need to do if I haven't done your suggestions.
>>
>> > ;(function( $ ){
>> >$.fn.quicksearch = function(options) {
>>
>> >options = jQuery.extend({
>> >position: 'prepend',
>> >attached: 'body',
>> >formId: 'quicksearch',
>> >labelText: 'Quick Search',
>> >labelClass: 'qs_label',
>> >inputText: null,
>> >inputClass: 'qs_input',
>> >loaderId: 'loader',
>> >loaderClass: 'loader',
>> >loaderImg: null,
>> >loaderText: '',
>> >stripeRowClass: null,
>> >hideElement: null,
>> >delay: 500,
>> >focusOnLoad: false,
>> >onBefore: null,
>> >onAfter: null,
>> >filter: null,
>> >randomElement: 
>> > 'qs'+Math.floor(Math.random()*100)
>> >}, options);
>>
>> >var timeout;
>> >var cache;
>> >var score = {};
>> >var el = this;
>> >var stripeRowLength = (!is_empty(options.stripeRowClass)) ?
>> > options.stripeRowClass.length : 0;
>> >var doStripe = (stripeRowLength > 0) ? true : false;
>>
>> >function is_empty (i)
>> >{
>> >return (i == null || i == undefined || i == false) 
>> > ? true: false;
>> >}
>>
>> >function get_cache (el)
>> >{
>> >cache = 
>> > $(el).not('.'+options.noResultsClass).map(function(){
>> >return 
>> > strip_html(normalise(this.innerHTML));
>> >});
>> >}
>>
>> >function normalise (i)
>> >{
>> >return $.trim(i.toLowerCase().replace(/\n/, 
>> > '').replace(/\s{2,}/, '
>> > '));
>> >}
>>
>> >function get_key()
>> >{
>> >var input = strip_html(normalise($('input[rel="' +
>> > options.randomElement + '"]').val()));
>>
>> >if (typeof options.filter == "function") { input = 
>> > options.filter
>> > (input); }
>>
>> >if (input.indexOf(' ') == -1)
>> >{
>> >return input;
>> >}
>> >else
>> >{
>> >return input.split(" ");
>> >}
>> >}
>>
>> >function test_key(k, value, type)
>> >{
>> >if (type == "string")
>> >{
>> >return test_key_string(k, value);
>> >}
>> >else
>> >{
>> >return test_key_arr(k, value);
>> >}
>> >}
>>
>> >function test_key_string(k, value)
>> >{
>> >return (value.indexOf(k) > -1);
>> >}
>>
>> >function test_key_arr(k, value)
>> >{
>> >for (var i = 0; i < k.length; i++) {
>> >var test = value.indexOf(k[i]);
>> >if (test == -1) {
>> > 

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread abovegaucho
I see...

All I have there is very basic things


$(document).ready(function () {
$('table tbody tr').quicksearch({
position: 'before',
attached: 'table',
labelText: 'Search the GPI Fuel Product Manuals',
delay: 50
});
})


If i take the delay:50 out I don't get a search box.  Sorry to be such
a pain...

On Nov 21, 11:27 am, "Rik Lomas" <[EMAIL PROTECTED]> wrote:
> I meant in the options, so when you do $(...).quicksearch( options );
> there isn't anything other than the basic stuff you need in the object
> you're passing through
>
> Rik
>
> 2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
>
>
> > First I must say that I really like your plugin...and I did go and
> > read some other stuff on your site about your latest
> > plugin...congrats!
>
> > I have the following options in the jquery.quicksearch.js file...I
> > believe that row striping is off...but I am not much of a programmer
> > so let me know what I need to do if I haven't done your suggestions.
>
> > ;(function( $ ){
> >        $.fn.quicksearch = function(options) {
>
> >                options = jQuery.extend({
> >                        position: 'prepend',
> >                        attached: 'body',
> >                        formId: 'quicksearch',
> >                        labelText: 'Quick Search',
> >                        labelClass: 'qs_label',
> >                        inputText: null,
> >                        inputClass: 'qs_input',
> >                        loaderId: 'loader',
> >                        loaderClass: 'loader',
> >                        loaderImg: null,
> >                        loaderText: '',
> >                        stripeRowClass: null,
> >                        hideElement: null,
> >                        delay: 500,
> >                        focusOnLoad: false,
> >                        onBefore: null,
> >                        onAfter: null,
> >                        filter: null,
> >                        randomElement: 'qs'+Math.floor(Math.random()*100)
> >                }, options);
>
> >                var timeout;
> >                var cache;
> >                var score = {};
> >                var el = this;
> >                var stripeRowLength = (!is_empty(options.stripeRowClass)) ?
> > options.stripeRowClass.length : 0;
> >                var doStripe = (stripeRowLength > 0) ? true : false;
>
> >                function is_empty (i)
> >                {
> >                        return (i == null || i == undefined || i == false) ? 
> > true: false;
> >                }
>
> >                function get_cache (el)
> >                {
> >                        cache = 
> > $(el).not('.'+options.noResultsClass).map(function(){
> >                                return strip_html(normalise(this.innerHTML));
> >                        });
> >                }
>
> >                function normalise (i)
> >                {
> >                        return $.trim(i.toLowerCase().replace(/\n/, 
> > '').replace(/\s{2,}/, '
> > '));
> >                }
>
> >                function get_key()
> >                {
> >                        var input = strip_html(normalise($('input[rel="' +
> > options.randomElement + '"]').val()));
>
> >                        if (typeof options.filter == "function") { input = 
> > options.filter
> > (input); }
>
> >                        if (input.indexOf(' ') == -1)
> >                        {
> >                                return input;
> >                        }
> >                        else
> >                        {
> >                                return input.split(" ");
> >                        }
> >                }
>
> >                function test_key(k, value, type)
> >                {
> >                        if (type == "string")
> >                        {
> >                                return test_key_string(k, value);
> >                        }
> >                        else
> >                        {
> >                                return test_key_arr(k, value);
> >                        }
> >                }
>
> >                function test_key_string(k, value)
> >                {
> >                        return (value.indexOf(k) > -1);
> >                }
>
> >                function test_key_arr(k, value)
> >                {
> >                        for (var i = 0; i < k.length; i++) {
> >                                var test = value.indexOf(k[i]);
> >                                if (test == -1) {
> >                                        return false;
> >                                }
> >                        }
> >                        return true;
> >                }
>
> >                function strip_html (input)
> >                {
> >                        var regexp = new RegExp(/\<[^\<]+\>/g);
> >                        var output = input.replace(regexp, "");
> >                        output = output.toLowerCase();
> >                   

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread Rik Lomas

I meant in the options, so when you do $(...).quicksearch( options );
there isn't anything other than the basic stuff you need in the object
you're passing through

Rik

2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> First I must say that I really like your plugin...and I did go and
> read some other stuff on your site about your latest
> plugin...congrats!
>
> I have the following options in the jquery.quicksearch.js file...I
> believe that row striping is off...but I am not much of a programmer
> so let me know what I need to do if I haven't done your suggestions.
>
> ;(function( $ ){
>$.fn.quicksearch = function(options) {
>
>options = jQuery.extend({
>position: 'prepend',
>attached: 'body',
>formId: 'quicksearch',
>labelText: 'Quick Search',
>labelClass: 'qs_label',
>inputText: null,
>inputClass: 'qs_input',
>loaderId: 'loader',
>loaderClass: 'loader',
>loaderImg: null,
>loaderText: '',
>stripeRowClass: null,
>hideElement: null,
>delay: 500,
>focusOnLoad: false,
>onBefore: null,
>onAfter: null,
>filter: null,
>randomElement: 'qs'+Math.floor(Math.random()*100)
>}, options);
>
>var timeout;
>var cache;
>var score = {};
>var el = this;
>var stripeRowLength = (!is_empty(options.stripeRowClass)) ?
> options.stripeRowClass.length : 0;
>var doStripe = (stripeRowLength > 0) ? true : false;
>
>function is_empty (i)
>{
>return (i == null || i == undefined || i == false) ? 
> true: false;
>}
>
>function get_cache (el)
>{
>cache = 
> $(el).not('.'+options.noResultsClass).map(function(){
>return strip_html(normalise(this.innerHTML));
>});
>}
>
>function normalise (i)
>{
>return $.trim(i.toLowerCase().replace(/\n/, 
> '').replace(/\s{2,}/, '
> '));
>}
>
>function get_key()
>{
>var input = strip_html(normalise($('input[rel="' +
> options.randomElement + '"]').val()));
>
>if (typeof options.filter == "function") { input = 
> options.filter
> (input); }
>
>if (input.indexOf(' ') == -1)
>{
>return input;
>}
>else
>{
>return input.split(" ");
>}
>}
>
>function test_key(k, value, type)
>{
>if (type == "string")
>{
>return test_key_string(k, value);
>}
>else
>{
>return test_key_arr(k, value);
>}
>}
>
>function test_key_string(k, value)
>{
>return (value.indexOf(k) > -1);
>}
>
>function test_key_arr(k, value)
>{
>for (var i = 0; i < k.length; i++) {
>var test = value.indexOf(k[i]);
>if (test == -1) {
>return false;
>}
>}
>return true;
>}
>
>function strip_html (input)
>{
>var regexp = new RegExp(/\<[^\<]+\>/g);
>var output = input.replace(regexp, "");
>output = output.toLowerCase();
>return output;
>}
>
>function select_element (el)
>{
>if(options.hideElement == "grandparent")
>{
>return $(el).parent().parent();
>}
>else if (options.hideElement == "parent")
>{
>return $(el).parent();
>}
>else
>{
>return $(el);
>}
>   

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread abovegaucho

First I must say that I really like your plugin...and I did go and
read some other stuff on your site about your latest
plugin...congrats!

I have the following options in the jquery.quicksearch.js file...I
believe that row striping is off...but I am not much of a programmer
so let me know what I need to do if I haven't done your suggestions.

;(function( $ ){
$.fn.quicksearch = function(options) {

options = jQuery.extend({
position: 'prepend',
attached: 'body',
formId: 'quicksearch',
labelText: 'Quick Search',
labelClass: 'qs_label',
inputText: null,
inputClass: 'qs_input',
loaderId: 'loader',
loaderClass: 'loader',
loaderImg: null,
loaderText: '',
stripeRowClass: null,
hideElement: null,
delay: 500,
focusOnLoad: false,
onBefore: null,
onAfter: null,
filter: null,
randomElement: 'qs'+Math.floor(Math.random()*100)
}, options);

var timeout;
var cache;
var score = {};
var el = this;
var stripeRowLength = (!is_empty(options.stripeRowClass)) ?
options.stripeRowClass.length : 0;
var doStripe = (stripeRowLength > 0) ? true : false;

function is_empty (i)
{
return (i == null || i == undefined || i == false) ? 
true: false;
}

function get_cache (el)
{
cache = 
$(el).not('.'+options.noResultsClass).map(function(){
return strip_html(normalise(this.innerHTML));
});
}

function normalise (i)
{
return $.trim(i.toLowerCase().replace(/\n/, 
'').replace(/\s{2,}/, '
'));
}

function get_key()
{
var input = strip_html(normalise($('input[rel="' +
options.randomElement + '"]').val()));

if (typeof options.filter == "function") { input = 
options.filter
(input); }

if (input.indexOf(' ') == -1)
{
return input;
}
else
{
return input.split(" ");
}
}

function test_key(k, value, type)
{
if (type == "string")
{
return test_key_string(k, value);
}
else
{
return test_key_arr(k, value);
}
}

function test_key_string(k, value)
{
return (value.indexOf(k) > -1);
}

function test_key_arr(k, value)
{
for (var i = 0; i < k.length; i++) {
var test = value.indexOf(k[i]);
if (test == -1) {
return false;
}
}
return true;
}

function strip_html (input)
{
var regexp = new RegExp(/\<[^\<]+\>/g);
var output = input.replace(regexp, "");
output = output.toLowerCase();
return output;
}

function select_element (el)
{
if(options.hideElement == "grandparent")
{
return $(el).parent().parent();
}
else if (options.hideElement == "parent")
{
return $(el).parent();
}
else
{
return $(el);
}
}

function stripe (el)
{
if (doStripe)
{
var i = 0;

select_element(el).filter(':visible').each(function () {

for (var j = 0; j < stripeRowLength; 
j++)
   

[jQuery] Re: jQuery Quicksearch Plugin Help

2008-11-21 Thread Rik Lomas

Hi, I'm the author of the quicksearch plugin, unfortunately the code
*is* a bit slow when dealing with large sets of data and it is one of
the issues I'm trying to fix, I would recommend not having any extra
features enabled to help speed it up (e.g. row striping)

Someone might correct me, but I do think that Javascript in general
isn't particularly speedy when dealing with that much data, so I might
be able to make that much difference to the speed, but I will carry on
working to get it faster

Rik


2008/11/21 abovegaucho <[EMAIL PROTECTED]>:
>
> I am having issues with the jquery.quicksearch plugin.  I first
> created some php code to pull a csv file into a table.  Then I used
> the plugin to search the table that was loaded through the php code.
>
> The table wasn't very large so it worked like a charm.  However, I
> tried doing the same thing with a much larger csv file (about 4000
> rows and 3 columns).  The plugin was very slow to respond.
>
> I also just ran some tests and it is slow in IE7 but it will
> work...now I did the same thing in firefox and it crashes firefox.  It
> also works in IE6 slow but it works.
>
> I did some google searches and found this:
>
> http://orderedlist.com/articles/live-search-with-quicksilver-style-fo...
>
> However this code is for list items  I am not much of a programmer
> so I don't know how to modify to search the large table that is loaded
> through the csv file.
>
> Any suggestions!?
>
> Thanks
>



-- 
Rik Lomas
http://rikrikrik.com


[jQuery] jQuery Quicksearch Plugin Help

2008-11-21 Thread abovegaucho

I am having issues with the jquery.quicksearch plugin.  I first
created some php code to pull a csv file into a table.  Then I used
the plugin to search the table that was loaded through the php code.

The table wasn't very large so it worked like a charm.  However, I
tried doing the same thing with a much larger csv file (about 4000
rows and 3 columns).  The plugin was very slow to respond.

I also just ran some tests and it is slow in IE7 but it will
work...now I did the same thing in firefox and it crashes firefox.  It
also works in IE6 slow but it works.

I did some google searches and found this:

http://orderedlist.com/articles/live-search-with-quicksilver-style-fo...

However this code is for list items  I am not much of a programmer
so I don't know how to modify to search the large table that is loaded
through the csv file.

Any suggestions!?

Thanks


[jQuery] quickSearch 2.0

2008-10-12 Thread lomas . rik

Hi guys,

I've been working on rewritting my quickSearch plugin for quite a
while now and I'm happy to let you know that I've finished. The new
version of quickSearch was written with speed in mind, it is now a lot
quicker than the previous version and it is completely backwards-
compatible with any previous code written.

http://rikrikrik.com/jquery/quicksearch/

If anyone finds any bugs or has any requests for features, let me know

Thanks,
Rik Lomas


[jQuery] Re: Question re: jQuery QuickSearch

2008-08-23 Thread McBilly Wilford Sy
Hi Mike,

Thank you very very much for the much detailed explanation. I went over it
and actually got my quicksearch to work! :)

If there is anything I can do next time, please don't hesitate to ask.

All the best,
McBilly

On Sat, Aug 23, 2008 at 9:34 PM, mickes <[EMAIL PROTECTED]> wrote:

>
> Try this:
>
> Here is a sample of the  section of my html document:
>
> 
> ASAP Summries 2-26-08 - Flight Options
> </
> script>
><script src="jquery.quicksearch.js" type="text/javascript"
> charset="utf-8">
>
>$(document).ready(function () {
>
>$('table#my_id_of_the_table tbody
> TR').quicksearch({
>attached: "table#asap",
>position: "before",
>stripeRowClass: ['odd', 'even'],
>labelText: 'This text will be
> displayed right before the search
> box',
>inputText: 'This text will initially
> be in the search box',
>loaderImg: 'loader.gif'
>});
>
>
>})
>
> media="all"
> title="" />
> 
>
> The start of the  section looks like this- remember it is vital
> that your id for the table matches the id you used above in the 
> section. For instance above I used my_id_of_the_table and you will
> find this same id in the  section below. The links to the home
> and back are not necessary. I have actual links there but you do not
> need them. :
>
> 
>
>  Home/Back
> 
> This is a header of the table
> 
> 
> ID
> Report ID(s)
> Event #
> GeneralProcessingDate/Time TH>GeneralProcessingLocal Time TH>GeneralProcessingNotes TH>GeneralProcessingFactor TH>GeneralProcessingLikelihood TH>GeneralProcessingRelated TH>GeneralProcessingStatement TH>GeneralProcessingTitle TH>GeneralProcessingPerson Responsible
> 
>
> 
>
> Your table needs to be embedded within a  Your Table 
> tag. The  and  elements for your table go here - Notice that
> the number of  elements below match the number of  elements
> above in the  section!
>
> 
> 3000
> 3008
> 1
> Mon, 15 Jan 2007 19:30 Z
> 
> 
> Blue
> Prob
> 3
> 
> Some text in a table cell
> Yes
> 
>
> The text below will follow your actual table - after the last 
> You need to make sure you close your html entities.
>
>   CLASS="count-field">Report generated Thu, 13 Mar 2008 15:28 Z DIV>
>
> I hope this helps!
> Take care,
> Mike
>
>
>
> On Aug 22, 2:32 pm, "McBilly Wilford Sy" <[EMAIL PROTECTED]>
> wrote:
> > Hello world!
> >
> > I am a new member and really really new with jQuery. Although I have seen
> > this work so many times before, this is the first time I am actually
> using
> > the codes. Anyway, I am trying to make Rik Lomas quicksearch plugin (
> http://rikrikrik.com/jquery/quicksearch/) to work.
> >
> > The problem is. I don't know how. There was actually no clear explanation
> or
> > tutorial on how to implement it.
> >
> > I tried adding a form with the id="quicksearch" with a textbox for
> > searching. Also, there is also a table with rows of different data.
> Anyway,
> > that is it. I really don't know what I'm lacking or how to make it work.
> >
> > Could somebody direct me to the right direction? Thank you very much! :)
> >
> > All the best,
> > McBilly
>


[jQuery] Re: Question re: jQuery QuickSearch

2008-08-23 Thread mickes

Try this:

Here is a sample of the  section of my html document:


ASAP Summries 2-26-08 - Flight Options



$(document).ready(function () {

$('table#my_id_of_the_table tbody 
TR').quicksearch({
attached: "table#asap",
position: "before",
stripeRowClass: ['odd', 'even'],
labelText: 'This text will be displayed 
right before the search
box',
inputText: 'This text will initially be 
in the search box',
loaderImg: 'loader.gif'
});


})




The start of the  section looks like this- remember it is vital
that your id for the table matches the id you used above in the 
section. For instance above I used my_id_of_the_table and you will
find this same id in the  section below. The links to the home
and back are not necessary. I have actual links there but you do not
need them. :



 Home/Back

This is a header of the table


ID
Report ID(s)
Event #
GeneralProcessingDate/TimeGeneralProcessingLocal TimeGeneralProcessingNotesGeneralProcessingFactorGeneralProcessingLikelihoodGeneralProcessingRelatedGeneralProcessingStatementGeneralProcessingTitleGeneralProcessingPerson Responsible




Your table needs to be embedded within a  Your Table 
tag. The  and  elements for your table go here - Notice that
the number of  elements below match the number of  elements
above in the  section!


3000
3008
1
Mon, 15 Jan 2007 19:30 Z


Blue
Prob
3

Some text in a table cell
Yes


The text below will follow your actual table - after the last 
You need to make sure you close your html entities.

 Report generated Thu, 13 Mar 2008 15:28 Z

I hope this helps!
Take care,
Mike



On Aug 22, 2:32 pm, "McBilly Wilford Sy" <[EMAIL PROTECTED]>
wrote:
> Hello world!
>
> I am a new member and really really new with jQuery. Although I have seen
> this work so many times before, this is the first time I am actually using
> the codes. Anyway, I am trying to make Rik Lomas quicksearch plugin 
> (http://rikrikrik.com/jquery/quicksearch/) to work.
>
> The problem is. I don't know how. There was actually no clear explanation or
> tutorial on how to implement it.
>
> I tried adding a form with the id="quicksearch" with a textbox for
> searching. Also, there is also a table with rows of different data. Anyway,
> that is it. I really don't know what I'm lacking or how to make it work.
>
> Could somebody direct me to the right direction? Thank you very much! :)
>
> All the best,
> McBilly


[jQuery] Question re: jQuery QuickSearch

2008-08-22 Thread McBilly Wilford Sy
Hello world!

I am a new member and really really new with jQuery. Although I have seen
this work so many times before, this is the first time I am actually using
the codes. Anyway, I am trying to make Rik Lomas quicksearch plugin (
http://rikrikrik.com/jquery/quicksearch/) to work.

The problem is. I don't know how. There was actually no clear explanation or
tutorial on how to implement it.

I tried adding a form with the id="quicksearch" with a textbox for
searching. Also, there is also a table with rows of different data. Anyway,
that is it. I really don't know what I'm lacking or how to make it work.

Could somebody direct me to the right direction? Thank you very much! :)

All the best,
McBilly


[jQuery] QuickSearch plugin - triggering events

2007-11-16 Thread Sean O


Hi,


I'm trying to modify "RikRIkRik" Lomas' excellent QuickSearch plugin.  I
want to set up clickable links to remove all sorting, and to setup
predefined sorts (defined strings sent to the text input).

I can clear and fill in the text input box easily enough, of course.  But
that does nothing.  All sorting changes are tied to keypress events
(as-you-type updates a'la iTunes), and I can't determine how to trigger a
sort otherwise.  There is no clearly defined function (reSort(), e.g.) to
reference in the code.

Has anyone else worked with this plugin?


Thanks,
SEAN O
__
www.sean-o.com
-- 
View this message in context: 
http://www.nabble.com/QuickSearch-plugin---triggering-events-tf4822839s27240.html#a13798000
Sent from the jQuery General Discussion mailing list archive at Nabble.com.