https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× This is the optional Forum header for the Suggestion Box.

Question: Render images with true / false values

  • de92085
  • de92085's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 7 months ago #760

I have a database with about 4,000,000 records. I want to use this TableJX to display portions of the records.

Many of the records are stored as True / False values. Instead of outputting the text 'True' or 'False,' I want to output a green check box and a red X.

How can I accomplish this without putting the full HTML IMG tag in the database fields? I don't want to do that for 4,000,000 records.

Please Log in or Create an account to join the conversation.

  • de92085
  • de92085's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 7 months ago #761

If the answer is "it can't be done without modifying the code," where is the backend code we have to modify?

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #762

Hi,

you can create view, something like this:

CREATE VIEW YourView AS
SELECT 
(case 
(when flag = True) then '<img src="pic1.gif" alt="P1" />'
(when flag = False) then '<img src="pic2.gif" alt="P2" />'
end) As Pic
FROM YourTable


... and display view with Table JX

flag = column in your table

Best regards,
Viljem

Last edit: 13 years 7 months ago by user62.

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.162 seconds

Contact Us

Contact us on Discord

Contact us on Facebook