Skip to content

Version

Version > 2023.02

Lookup Fields

View-Parent Button ("Eye"-Button)

Replace all "eye"-icons

By default, if configured, lookup fields get a "View Parent" button with an "eye"-icon:

Default "eye"-icon:

To change the icon you can use the following function:

1
2
3
// file: hooks/TABLENAME-dv.js
AppGiniHelper.DV.replaceViewIcons("cog");
// parameter: custom icon name

"eye"-icon has been replaced by "cog"-icon

Wanna change all "Eye"-buttons in all Detail Views?
See Tips below!


Table dependent icons

You can define a separate icon for each table, which is then displayed in each View-Parent button for that table.

1
2
// file: hooks/TABLENAME-dv.js
AppGiniHelper.DV.replaceViewIcon("TABLENAME", "ICON");

Example

1
2
// file: hooks/TABLENAME-dv.js
AppGiniHelper.dv.replaceViewIcon("locations", "map-marker");

"eye"-icon has been replaced by "map-marker"-icon

Table dependent Icon and Caption

Example

1
2
// file: hooks/TABLENAME-dv.js
AppGiniHelper.DV.replaceViewIcon("locations", "map-marker", "Dienstsitz");

"eye"-icon has been replaced by "map-marker"-icon + custom caption


Tip: Apply changes globally

In the example above we have changed the icons in one Detail View. You can also apply this globally by writing the <script/> in hooks/header-extras.php :

1
2
3
4
5
6
7
<!-- file: hooks/header-extras.php -->
<script>
    var dv = AppGiniHelper.DV;
    if (dv != null) {
        dv.replaceViewIcons("cog");
    }
</script>

You can even use "chaining"-technique:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<!-- file: hooks/header-extras.php -->
<script>
    var dv = AppGiniHelper.DV;
    if (dv != null) {
        dv.replaceViewIcons("cog")
            .replaceViewIcon("employees", "user", "MA")
            .replaceViewIcon("locations", "map-marker", "Dienstsitz")
            .replaceViewIcon("sectors", "folder-close", "Sachgebiet");
    }
</script>

See also