Skip to content

Toolbar / Add Link

Basic Usage

Opens a URL ( href as 1st parameter). Mostly used parameters href , icon and text (caption).

1
2
3
jQuery(document).ready(function() {
    AppGiniHelper.TV.addLink("url", "icon", "text");
});

Extended Usage

Additional parameters variation (button style), prompt (confirmation message box before opening href) and target (browser tab).

1
2
3
jQuery(document).ready(function() {
    AppGiniHelper.TV.addLink("url", "icon", "text", variation, "prompt", "target");
});

Professional Usage: Callback Example

Professionals

Last parameter (callable function) allows customization per row.

Check the values pk and data on console to see available options.

1
2
3
4
5
6
tv.addLink("href", "icon", "text", Variation.default, "prompt", "target",
    function(pk, data) {
        // onBeforeRender callback function
        console.log(pk);
        console.log(data);
    });

Parameters

  • url (string, addLink only)
    You can use placeholder %ID% in url. It will be replaced at runtime by each row's primary key Example: tv.addLink("my_custom_page.php?id=%ID%", "flash");

  • icon (string)
    Name of the icon without prefix, see Icons

  • text (string)
    Button text

  • variation
    See Variation

  • prompt (string, optional, addLink only)
    Message text for confirmation prompt

  • target (string, optional, addLink only)

    Browser tab target, for example "_self" (default), "_blank" (new tab) or any other_string

See also