[jQuery] Re: show hide random rows

2009-03-19 Thread Sean O
Scott, Ricardo, great thoughts and great code. It is an interesting issue with many attack vectors; I hope the OP is getting something out of all this... I will expect at least as much code and analysis for my next posted problem! ;) SEAN O _ http://www.sean-o.com

[jQuery] Re: show hide random rows

2009-03-18 Thread Sean O
Bob, Try this: http://jsbin.com/esoba Code: http://jsbin.com/esoba/edit It shouldn't matter how YUI is IDing your table rows, as you can pluck them out by index. HTH, SEAN O http://www.sean-o.com http://twitter.com/seanodotcom Bob O-2 wrote: I was wondering if anyone could point me

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
Bob O wrote: Basically i have a YUI datatable and i want to use jQuery to hide all but a user generated number of rows that are random selected Something like this might be what you're looking for: http://jsbin.com/ozafa/edit The important part is this: var $rows = $(#myTable tbody

[jQuery] Re: show hide random rows

2009-03-18 Thread Sean O
Scott, Nice job. I like the logic, and the fading out of unselected rows. My solution was, admittedly, a quick one. It certainly wouldn't scale past 1,000 rows or so -- especially with the majority # selected -- but if the 10/50 number is firm, seemed to work OK. --SEAN O Scott Sauyet-3

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
Sean O wrote: Nice job. I like the logic, and the fading out of unselected rows. My solution was, admittedly, a quick one. It certainly wouldn't scale past 1,000 rows or so -- especially with the majority # selected -- but if the 10/50 number is firm, seemed to work OK. Yours is probably

[jQuery] Re: show hide random rows

2009-03-18 Thread ricardobeat
If you need performance, this should be it: http://jsbin.com/uvuzi/edit It sorts the rows using the Fisher-Yates shuffling algorithm. Despite throwing elements around in an array, it's faster than the pure mathematical solution because you don't need to filter out duplicate random numbers. An

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
ricardobeat wrote: If you need performance, this should be it: http://jsbin.com/uvuzi/edit It sorts the rows using the Fisher-Yates shuffling algorithm. Despite throwing elements around in an array, it's faster than the pure mathematical solution because you don't need to filter out duplicate