Quantcast
Channel: SCN : Blog List - All Communities
Viewing all articles
Browse latest Browse all 2548

Custom Control: Highlightable Text

$
0
0

Inspired by Sai's blog Input: How to highlight suggestion items

 

It is common that we need to highlight text in table, list and other container controls. And we do not wish to iterate through all the items to highlight the text.

One way to handle this is to use a custom control and a model. The former is responsible for highlighting the text and the latter is responsible for informing the control what is the text to highlight.

 

Here is the JSBIN

JS Bin - Collaborative JavaScript Debugging

 

As an enhancement, we can alter this control to do underlining or/and handle regular expression for highlighting text.

 

Thanks

-D


Viewing all articles
Browse latest Browse all 2548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>