Switch display value of 0 and 1

relliott 20 Sep, 2017
Hello,

I have a simple database for storing statuses of a lead. In the database I have a fieldset of "active". The data is stored 0 for no and 1 for yes. How do I switch the datashown on my connection from 0 and 1's to No and Yes?

Thanks,

Ryan
Max_admin 29 Sep, 2017
1 Likes
Hi Ryan,

This is in a table view ? if yes then you will need a "Switch" function called in the "Columns views".

Example:
Model.field:{fn:myswitch}


Then in the "myswitch" function, set the "Data provider" to:
{var:table_view_name.row.Model.field}

Values setup:

0:No
1:Yes


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.