Friday, February 28, 2020

APEX: text highlighter with Mark.js

Today I have a need to highlighter some of the key word(typed in search string) in the report and I find out this wonderful Mark.js library(you can find all the detail here https://markjs.io/)

Here is what I did for the Classic Report:

1. include the javascripts: include this url in the File URLS section of the page(Here I am using the JQuery model):

https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js

2. put following css in the CSS inline section of the page:

mark {
  padding: 0;
  background: #00ff19;
  color: black;  
}

3. create a after refresh DA and put following javascripts in the action:

$('.t-Report-cell').mark($v('Pxx_SEARCH'), {"separateWordSearch": false});

Pxx_SEARCH is my search item in my page

There are many options available(check detail in https://markjs.io/). You can set up by your choice.

1 comment:

  1. Water Hack Burns 2 lb of Fat OVERNIGHT

    Over 160k women and men are using a simple and secret "liquid hack" to drop 2 lbs each night while they sleep.

    It's proven and it works every time.

    Just follow these easy step:

    1) Go grab a drinking glass and fill it with water half glass

    2) Now use this crazy HACK

    and you'll be 2 lbs thinner the next day!

    ReplyDelete