Guide 96 – Improving the presentation of single or multiple Lookups |
6/3/2025 2:15:00 PM |
PHPRunner Tips and Tricks | |
![]() When we replace an "id" with a "name or key" in the table's display, we see text that is usually simple but sufficient. When, instead of having a single value in a field, we have multiple values, displaying these texts one after the other, separated by a comma, is usually insufficient.
Objetive Improve the display of "Lookup" fields by highlighting the values, both in the standard Lookup and if a Plugin is used ( The plugins already have a version for PHPRunner v11 ) DEMO: https://fhumanes.com/test_lookup/
But before specifying the code, I will indicate that the Bootstrap 3 "badge" element will be used, which is what PHPRunner incorporates, but modifying it to our liking. In the case of using the standard PHPRunner solution, we must know that the program gives control to the code that we write in the CUSTOM field for each of the values and that these values that it returns are not the "id's", but the "name or keys". Taking these circumstances into account, the code we have to include in Field Custom is: $in = $value; We also have to include in CSS Custom, the style changes we want: .badge { This code is the same for a single value or multiple values in the same field. If you are interested in this article or want to get the code, follow this link . |
|