Print a lookup field as a check

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
balfons
Veteran Member
Posts: 91
Joined: 2018-10-22 15:27

Print a lookup field as a check

Post by balfons » 2021-09-17 11:11

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!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Print a lookup field as a check

Post by pbottcher » 2021-10-07 21:19

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>');
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply