A quick tip if you want to allow users to sort on an Image column in a PeopleTools grid. Typically this is used in RAG (Red Amber Green) type traffic light images for KPI/target values. The tip is simple but effective:
Don’t use an Image column type – use an HTMLAREA and embed a hidden value into a HTML comment in the column followed by a link to the image you want to display.
Given a HTML area linked to RECORD.MY_FIELD on the grid, use RowInit PeopleCode to construct the HTML like this:
RECORD.MY_FIELD.Value = '<!--' | {the_value_to_sort_on} | '-->' | "<img src='%Image(MY_IMAGE)'>"; |
where the “value to sort on” could be a literal or a RECORD.FIELD.Value reference or indeed any calculated value. Just make sure the values you assign reflect the collating sequence you want for the images.
Oh … you might want to centre the image in the column using a DIV
<div style=”text-align: center;”>
… the img tag above
</div>
Enjoy.