On 06 Jul 2009, at 10:27, Jeztah wrote:

> I have a site that can be heavy server load and decided to try and
> take out some filtering on a page..
>
> Example. I have a page with a table of search results and would like
> to be able to put client side searching (ala Crtl+f on firefox)....
>
> What i would like to do is make the rows not matched less opaque in
> the table so the rows that matched the string found stand out more...
>
> Anyone done this before or know of a good resource i can look at to
> get me started....

Haven't done it, but I would just pass in a structured form of the  
data on page load (json for example). You can then write some  
javascript to run through your data store and highlight the row  
according to the id available in the store.

[
   {id: 2, content: "Lorem ipsum dolor sit amet"},
   {id: 5, content: "consectetur adipisicing elit"}
]

<table>
    <tbody>
    <tr id="record_2"><td>Lorem ipsum dolor sit amet</td></tr>
    <tr id="record_5"><td>Lorem ipsum dolor sit amet</td></tr>
    </tbody>
</table>

When a search is done for "adi", your javascript search function  
returns the record with id 5, and you highlight $('record_5'). The  
complexity of your search function and the way to implement it would  
depend on the features you want to provide (case insensitive search,  
pattern matching, etc.).


Best regards

Peter De Berdt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to