Page 1 of 1

Print a lookup field as a check

Posted: 2021-09-17 11:11
by balfons
Hi everyone! I have a question about lookup fields.

In my project I have a table 'people' with this fields:

- Name (varchar)
- Surname (varchar)
- Active (varchar / checkbox)

I am using all fields in another table 'place':

- Place (varchar)
- Name (lookup field)
- Surname (lookup field)
- Active (lookup field)

And now the field "Active" in the table 'place' is printed as a number (1 - checked, 0 -unchecked). Is it possible to have this lookup field printed as a checkbox as in the "source" table?

Thanks in advance!

Re: Print a lookup field as a check

Posted: 2021-10-07 21:19
by pbottcher
Hi,

you can try to add to your hooks/place-tv.js file:

Code: Select all

$j(function() {
   $j('.place-Active:contains(1)').find('a').text('').append('<i class="glyphicon glyphicon-check"></i>');
   $j('.place-Active:contains(0)').find('a').text('').append('<i class="glyphicon glyphicon-unchecked"></i>');
})