Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Display icons for values
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Display icons for values
#11704
Display icons for values 13 Years, 4 Months ago Karma: 0
Really enjoying Data Tables. Very powerful, great work!

I have this question: I would like to display text based upon the value of a field, like:
if assessment_type (a database field) = 0 then display "Extended"
if assessment_type = 1 then display "Brief"

How can I do this in Data Tables?
The administrator has disabled public write access.
 
#11711
Re:Display icons for values 13 Years, 4 Months ago Karma: 748
Hello,

Sorry, but currently it is impossible to show specific content based on column value. We will think about implementation of this feature in a future release.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#11747
Re:Display icons for values 13 Years, 4 Months ago Karma: 0
Thanks. If it is possible to code for something like this in the future, it would be great. However, the Tables product is very helpful already.
Paul Earley
The administrator has disabled public write access.
 
#12162
Re:Display icons for values 13 Years, 3 Months ago Karma: 0
Not sure if this helps at all (or if I can explain it!), but I am using a combination of SQL and the Columns Settings to display multiple images in a column if certain conditions are met.
Let me first explain what I wanted to achieve:
I wanted a list of people, in this case people related to local theatre, and listed against each I wanted a 'Details' section that showed a series of images indicating if they were a director, choreographer, if they would travel etc etc. People could belong to any/all/none of these groups.


So, my database table looked something like this:

Name, address, email, website, director, choreographer, will travel
MyName, MyAddress, MyEmail, Myweb, Y, N, Y
Name2, Address2, Email2, web2, N, Y, N

Each detail part has an associated image (IE director.png, choreographer.png, travel.png)
and I also have a completely blank image (noimage.png)

So I used SQL to make the relevant detail columns either one of the proper images, or the blank image using CASE:

SELECT Name, email, website, '' AS details,

CASE WHEN director = 'Y'
THEN 'director.png'
ELSE 'noimage.png'
END AS 'director',

CASE WHEN choreographer = 'Y'
THEN 'Choreographer.png'
ELSE 'noimage.png'
END AS 'choreographer'

CASE WHEN director = 'Y'
THEN 'travel.png'
ELSE 'noimage.png'
END AS 'travel'

FROM Mytable

Next is setting up the column settings.
I set up rules for the director/choreographer/travel columns to be hidden, and the usual rules for website and email and then set up the details column as follows:
IN FORMAT
<img src="images/{$columns:director}" />&nbsp;<img src="images/{$columns:choreographer}" />&nbsp;<img src="images/{$columns:travel}" />

You can see the results of my testing here:
www.mtnz.co.nz/demo/calendar
which might make it a bit clearer
The administrator has disabled public write access.
 
Go to topPage: 1