Jump to content

Change Color for Sorting Icon on Reports


Recommended Posts

Hi nameless!

I had similar issue in the past.

Here is a JavaScript snippet that should do the job.
 

<script>

if(typeof iconChanger == 'undefined') {
const iconChanger = () => {
const regEx = /com\/images\/set\d_/;
const config = { childList: true, subtree: true }
const handler = () => {
let ascIcon = document.querySelector('img[src*="descending.gif"]')
let desIcon = document.querySelector('img[src*="ascending.gif"]')
if(ascIcon!==null) {
ascIcon.setAttribute('src', ascIcon.getAttribute('src').replace(regEx,'com/images/set1_'))
}
else if(desIcon!==null) {
desIcon.setAttribute('src', desIcon.getAttribute('src').replace(regEx,'com/images/set1_'))
}  
}
const observer = new MutationObserver(handler)
observer.observe(document.querySelector('body'), config)
handler()
document.removeEventListener('DataPageReady', iconChanger)
}
document.addEventListener('DataPageReady', iconChanger )

}

</script>

It works as it is. Just add it to the header or footer of your results  page

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...