[mark.js] can you provide me a sample implementation

[mark.js] can you provide me a sample implementation

  
Forge Component
(2)
Published on 15 Jan by leonardo.fernandes
2 votes
Published on 15 Jan by leonardo.fernandes

Hi,

    i need to highlight the search text in the table record results. So can you please provide me a sample implementation of mark.js?


Thanks,

Ranjith.S

Hi Ranjith.

You can use the MarkContent web block, and place the table records inside of it. Let me know if you need any more help.

Hi Leonardo,

             Thanks for the quick response. i have tried the steps that you have given, but still the table record results are not highlighted as per the search text. Please check my control layout screen in the attachment and let me know if you need any more information.

Thanks in advance,

Ranjith.S

Solution

Hi Leonardo,

            It works now. The input keyword was going null and that was the reason no words were highlighted.

Thanks,

Ranjith.S 

Solution

Hi Ranjith. I'm glad you got it working, but I didn't understand what went wrong.

The input keyword is the phrase you want to highlight (it actually split each word in the phrase and highlights individual words). It's a mandatory input, so I'm not sure how you forgot to fill it in - unless it was human error. Or did you find any bug in the component that I'm not aware of?

Thanks.

Hi Leonardo,

          There is no bug in the component. The issue was the local variable which i have assigned to the component's mandatory input was becoming 'empty' during my search, so nothing was highlighted. After i have corrected that issue everything started working.

Thanks.